[Bf-blender-cvs] [917d7a6cea9] modifier-panels-ui: Merge branch 'master' into modifier-panels-ui
Hans Goudey
noreply at git.blender.org
Fri May 1 17:09:45 CEST 2020
Commit: 917d7a6cea9919adeb0aeb991db290415c1a31b3
Author: Hans Goudey
Date: Thu Apr 30 16:19:06 2020 -0500
Branches: modifier-panels-ui
https://developer.blender.org/rB917d7a6cea9919adeb0aeb991db290415c1a31b3
Merge branch 'master' into modifier-panels-ui
===================================================================
===================================================================
diff --cc source/blender/editors/interface/interface_panel.c
index ef75c7f08bd,04179721305..3f9e06f9034
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@@ -1271,6 -877,20 +1271,16 @@@ static int get_panel_real_ofsx(Panel *p
}
}
+ bool UI_panel_is_dragging(const struct Panel *panel)
+ {
+ uiHandlePanelData *data = panel->activedata;
+ if (!data) {
+ return false;
+ }
+
+ return data->is_drag_drop;
+ }
+
-typedef struct PanelSort {
- Panel *panel, *orig;
-} PanelSort;
-
/**
* \note about sorting;
* the sortorder has a lower value for new panels being added.
diff --cc source/blender/editors/screen/area.c
index 8acd4e26186,bbc6b9e7c86..848517ce257
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@@ -2630,33 -2584,12 +2631,43 @@@ void ED_region_panels_layout_ex(const b
}
}
+ if (panel && UI_panel_is_dragging(panel)) {
+ /* Prevent View2d.tot rectangle size changes while dragging panels. */
+ update_tot_size = false;
+ }
+
- ed_panel_draw(C, area, region, ®ion->panels, pt, panel, w, em, vertical);
+ ed_panel_draw(C, area, region, ®ion->panels, pt, panel, w, em, vertical, NULL);
+ }
+
+ if (has_recreate_panel) {
+ /* List panels have some margin to differentiate them from regular panels. */
+ w -= UI_LIST_PANEL_MARGIN * 2.0f;
+ for (Panel *panel = region->panels.first; panel; panel = panel->next) {
+ if (panel->type != NULL) { /* Some panels don't have a type.. */
+ if (panel->type->flag & PNL_LIST) {
++ if (panel && UI_panel_is_dragging(panel)) {
++ /* Prevent View2d.tot rectangle size changes while dragging panels. */
++ update_tot_size = false;
++ }
++
+ /* Use a unique identifier for list panels, otherwise an old block for a different
+ * panel of the same type might be found. */
+ char unique_panel_str[8];
+ UI_list_panel_unique_str(panel, unique_panel_str);
+
+ ed_panel_draw(C,
+ area,
+ region,
+ ®ion->panels,
+ panel->type,
+ panel,
+ w,
+ em,
+ vertical,
+ unique_panel_str);
+ }
+ }
+ }
}
/* align panels and return size */
diff --cc source/blender/gpencil_modifiers/intern/MOD_gpenciltexture.c
index 9896d174677,15e069fc162..b29f31e5ead
--- a/source/blender/gpencil_modifiers/intern/MOD_gpenciltexture.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpenciltexture.c
@@@ -151,56 -140,8 +151,56 @@@ static void bakeModifier(struct Main *U
}
}
+static void panel_draw(const bContext *C, Panel *panel)
+{
+ uiLayout *col;
+ uiLayout *layout = panel->layout;
+
+ PointerRNA ptr;
+ gpencil_modifier_panel_get_property_pointers(C, panel, NULL, &ptr);
+ gpencil_modifier_panel_buttons(C, panel);
+
+ int mode = RNA_enum_get(&ptr, "mode");
+
+ uiLayoutSetPropSep(layout, true);
+
+ uiItemR(layout, &ptr, "mode", 0, NULL, ICON_NONE);
+
+ if (ELEM(mode, STROKE, STROKE_AND_FILL)) {
+ col = uiLayoutColumn(layout, false);
+ uiItemR(col, &ptr, "fit_method", 0, IFACE_("Stroke Fit Method"), ICON_NONE);
+ uiItemR(col, &ptr, "uv_offset", 0, NULL, ICON_NONE);
+ uiItemR(col, &ptr, "uv_scale", 0, IFACE_("Scale"), ICON_NONE);
+ }
+
+ if (mode == STROKE_AND_FILL) {
+ uiItemS(layout);
+ }
+
+ if (ELEM(mode, FILL, STROKE_AND_FILL)) {
+ col = uiLayoutColumn(layout, false);
+ uiItemR(col, &ptr, "fill_rotation", 0, NULL, ICON_NONE);
+ uiItemR(col, &ptr, "fill_offset", 0, IFACE_("Offset"), ICON_NONE);
+ uiItemR(col, &ptr, "fill_scale", 0, IFACE_("Scale"), ICON_NONE);
+ }
+
+ gpencil_modifier_panel_end(layout, &ptr);
+}
+
+static void mask_panel_draw(const bContext *C, Panel *panel)
+{
+ gpencil_modifier_masking_panel_draw(C, panel, true, true);
+}
+
+static void panelRegister(ARegionType *region_type)
+{
+ PanelType *panel_type = gpencil_modifier_panel_register(region_type, "Texture", panel_draw);
+ gpencil_modifier_subpanel_register(
+ region_type, "texture_mask", "Influence", NULL, mask_panel_draw, panel_type);
+}
+
GpencilModifierTypeInfo modifierType_Gpencil_Texture = {
- /* name */ "Texture",
+ /* name */ "Texture Mapping",
/* structName */ "TextureGpencilModifierData",
/* structSize */ sizeof(TextureGpencilModifierData),
/* type */ eGpencilModifierTypeType_Gpencil,
More information about the Bf-blender-cvs
mailing list