[Bf-blender-cvs] [06de1bddae6] master: UI: Small Tweaks to Modifier Layouts for Consistency

Hans Goudey noreply at git.blender.org
Thu Jul 2 16:47:10 CEST 2020


Commit: 06de1bddae65dca06ec44b996372ce6a6e8d70e8
Author: Hans Goudey
Date:   Thu Jul 2 10:47:02 2020 -0400
Branches: master
https://developer.blender.org/rB06de1bddae65dca06ec44b996372ce6a6e8d70e8

UI: Small Tweaks to Modifier Layouts for Consistency

These changes are smaller, made based on feedback and a pass on all
the layouts for clarity and consistency. The Multires modifier UI will
be addressed in a separate patch. Here is an overview of the changes:

Renaming Options:
  - Build: "Start" -> "Start Frame"
  - Curve: "From Radius" -> "Size from Radius"
  - Screw: "Calc Order" -> "Calculate Order"
  - Displace, Warp, Wave: "Texture Coordinates Object" -> "Object"

Move Mode Toggle to Top & Expand:
  - Bevel, Boolean, Normal Edit, Subdivision

Use Columns for Tighter Spacing:
  - Displace, Explode, Ocean, Particle Instance, Remesh, Shrinkwrap,
    Solidify, Warp, Weighted Normal, Wave

Misc:
  - Bevel: Set inactive properties for vertex bevel
  - Mesh Sequence Cache: Remove box for cache file
  - Skin: Don't align "Mark Loose" and "Clear Loose"
  - Array: Expand relative offset subpanel by default
  - Array: Move start cap, end cap to a new subpanel
  - Bevel: Move width type above width

Differential Revision: https://developer.blender.org/D8115

===================================================================

M	source/blender/makesrna/intern/rna_modifier.c
M	source/blender/modifiers/intern/MOD_array.c
M	source/blender/modifiers/intern/MOD_bevel.c
M	source/blender/modifiers/intern/MOD_boolean.c
M	source/blender/modifiers/intern/MOD_displace.c
M	source/blender/modifiers/intern/MOD_explode.c
M	source/blender/modifiers/intern/MOD_meshsequencecache.c
M	source/blender/modifiers/intern/MOD_normal_edit.c
M	source/blender/modifiers/intern/MOD_ocean.c
M	source/blender/modifiers/intern/MOD_particleinstance.c
M	source/blender/modifiers/intern/MOD_remesh.c
M	source/blender/modifiers/intern/MOD_shrinkwrap.c
M	source/blender/modifiers/intern/MOD_skin.c
M	source/blender/modifiers/intern/MOD_solidify.c
M	source/blender/modifiers/intern/MOD_subsurf.c
M	source/blender/modifiers/intern/MOD_warp.c
M	source/blender/modifiers/intern/MOD_wave.c
M	source/blender/modifiers/intern/MOD_weighted_normal.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index 57e46314777..e8d5d75097a 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -2086,7 +2086,7 @@ static void rna_def_modifier_build(BlenderRNA *brna)
   prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_TIME);
   RNA_def_property_float_sdna(prop, NULL, "start");
   RNA_def_property_range(prop, MINAFRAMEF, MAXFRAMEF);
-  RNA_def_property_ui_text(prop, "Start", "Start frame of the effect");
+  RNA_def_property_ui_text(prop, "Start Frame", "Start frame of the effect");
   RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
   prop = RNA_def_property(srna, "frame_duration", PROP_FLOAT, PROP_TIME);
@@ -3415,7 +3415,7 @@ static void rna_def_modifier_cast(BlenderRNA *brna)
   prop = RNA_def_property(srna, "use_radius_as_size", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_CAST_SIZE_FROM_RADIUS);
   RNA_def_property_ui_text(
-      prop, "From Radius", "Use radius as size of projection shape (0 = auto)");
+      prop, "Size from Radius", "Use radius as size of projection shape (0 = auto)");
   RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
   prop = RNA_def_property(srna, "use_transform", PROP_BOOLEAN, PROP_NONE);
@@ -4800,7 +4800,7 @@ static void rna_def_modifier_screw(BlenderRNA *brna)
   prop = RNA_def_property(srna, "use_normal_calculate", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_SCREW_NORMAL_CALC);
   RNA_def_property_ui_text(
-      prop, "Calc Order", "Calculate the order of edges (needed for meshes, but not curves)");
+      prop, "Calculate Order", "Calculate the order of edges (needed for meshes, but not curves)");
   RNA_def_property_update(prop, 0, "rna_Modifier_update");
 
   prop = RNA_def_property(srna, "use_object_screw_offset", PROP_BOOLEAN, PROP_NONE);
diff --git a/source/blender/modifiers/intern/MOD_array.c b/source/blender/modifiers/intern/MOD_array.c
index e1f271e83c3..48d69f8e02c 100644
--- a/source/blender/modifiers/intern/MOD_array.c
+++ b/source/blender/modifiers/intern/MOD_array.c
@@ -76,6 +76,9 @@ static void initData(ModifierData *md)
   amd->fit_type = MOD_ARR_FIXEDCOUNT;
   amd->offset_type = MOD_ARR_OFF_RELATIVE;
   amd->flags = 0;
+
+  /* Open the first subpanel by default, it corresspnds to Relative offset which is enabled too. */
+  md->ui_expand_flag = (1 << 0) | (1 << 1);
 }
 
 static void foreachObjectLink(ModifierData *md, Object *ob, ObjectWalkFunc walk, void *userData)
@@ -835,7 +838,6 @@ static bool isDisabled(const struct Scene *UNUSED(scene),
 
 static void panel_draw(const bContext *C, Panel *panel)
 {
-  uiLayout *col;
   uiLayout *layout = panel->layout;
 
   PointerRNA ptr;
@@ -857,12 +859,6 @@ static void panel_draw(const bContext *C, Panel *panel)
     uiItemR(layout, &ptr, "curve", 0, NULL, ICON_NONE);
   }
 
-  uiItemS(layout);
-
-  col = uiLayoutColumn(layout, false);
-  uiItemR(col, &ptr, "start_cap", 0, IFACE_("Cap Start"), ICON_NONE);
-  uiItemR(col, &ptr, "end_cap", 0, IFACE_("End"), ICON_NONE);
-
   modifier_panel_end(layout, &ptr);
 }
 
@@ -984,6 +980,21 @@ static void uv_panel_draw(const bContext *C, Panel *panel)
   uiItemR(col, &ptr, "offset_v", UI_ITEM_R_EXPAND, IFACE_("V"), ICON_NONE);
 }
 
+static void caps_panel_draw(const bContext *C, Panel *panel)
+{
+  uiLayout *col;
+  uiLayout *layout = panel->layout;
+
+  PointerRNA ptr;
+  modifier_panel_get_property_pointers(C, panel, NULL, &ptr);
+
+  uiLayoutSetPropSep(layout, true);
+
+  col = uiLayoutColumn(layout, false);
+  uiItemR(col, &ptr, "start_cap", 0, IFACE_("Cap Start"), ICON_NONE);
+  uiItemR(col, &ptr, "end_cap", 0, IFACE_("End"), ICON_NONE);
+}
+
 static void panelRegister(ARegionType *region_type)
 {
   PanelType *panel_type = modifier_panel_register(region_type, eModifierType_Array, panel_draw);
@@ -1004,6 +1015,7 @@ static void panelRegister(ARegionType *region_type)
   modifier_subpanel_register(
       region_type, "merge", "", symmetry_panel_header_draw, symmetry_panel_draw, panel_type);
   modifier_subpanel_register(region_type, "uv", "UVs", NULL, uv_panel_draw, panel_type);
+  modifier_subpanel_register(region_type, "caps", "Caps", NULL, caps_panel_draw, panel_type);
 }
 
 ModifierTypeInfo modifierType_Array = {
diff --git a/source/blender/modifiers/intern/MOD_bevel.c b/source/blender/modifiers/intern/MOD_bevel.c
index 0a1eb8eba10..21bb7f4764a 100644
--- a/source/blender/modifiers/intern/MOD_bevel.c
+++ b/source/blender/modifiers/intern/MOD_bevel.c
@@ -279,51 +279,38 @@ static bool isDisabled(const Scene *UNUSED(scene), ModifierData *md, bool UNUSED
 
 static void panel_draw(const bContext *C, Panel *panel)
 {
-  uiLayout *col;
+  uiLayout *col, *sub;
   uiLayout *layout = panel->layout;
 
   PointerRNA ptr;
   PointerRNA ob_ptr;
   modifier_panel_get_property_pointers(C, panel, &ob_ptr, &ptr);
 
+  bool edge_bevel = RNA_enum_get(&ptr, "affect") != MOD_BEVEL_VERT;
+
+  uiItemR(layout, &ptr, "affect", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
+
   uiLayoutSetPropSep(layout, true);
 
   col = uiLayoutColumn(layout, false);
-  const char *offset_name = "";
+  uiItemR(col, &ptr, "offset_type", 0, NULL, ICON_NONE);
   if (RNA_enum_get(&ptr, "offset_type") == BEVEL_AMT_PERCENT) {
     uiItemR(col, &ptr, "width_pct", 0, NULL, ICON_NONE);
   }
   else {
-    switch (RNA_enum_get(&ptr, "offset_type")) {
-      case BEVEL_AMT_DEPTH:
-        offset_name = "Depth";
-        break;
-      case BEVEL_AMT_WIDTH:
-        offset_name = "Width";
-        break;
-      case BEVEL_AMT_OFFSET:
-        offset_name = "Offset";
-        break;
-      case BEVEL_AMT_ABSOLUTE:
-        offset_name = "Absolute";
-        break;
-    }
-    uiItemR(col, &ptr, "width", 0, IFACE_(offset_name), ICON_NONE);
+    uiItemR(col, &ptr, "width", 0, IFACE_("Amount"), ICON_NONE);
   }
-  uiItemR(col, &ptr, "offset_type", 0, NULL, ICON_NONE);
 
   uiItemR(layout, &ptr, "segments", 0, NULL, ICON_NONE);
 
   uiItemS(layout);
 
-  uiItemR(layout, &ptr, "affect", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
-
-  uiItemS(layout);
-
   col = uiLayoutColumn(layout, false);
   uiItemR(col, &ptr, "limit_method", 0, NULL, ICON_NONE);
   int limit_method = RNA_enum_get(&ptr, "limit_method");
-  if (limit_method == MOD_BEVEL_ANGLE) {
+  if (limit_method != MOD_BEVEL_ANGLE) {
+    sub = uiLayoutColumn(col, false);
+    uiLayoutSetActive(sub, edge_bevel);
     uiItemR(col, &ptr, "angle_limit", 0, NULL, ICON_NONE);
   }
   else if (limit_method == MOD_BEVEL_VGROUP) {
@@ -333,25 +320,78 @@ static void panel_draw(const bContext *C, Panel *panel)
   modifier_panel_end(layout, &ptr);
 }
 
+static void profile_panel_draw(const bContext *C, Panel *panel)
+{
+  uiLayout *row;
+  uiLayout *layout = panel->layout;
+
+  PointerRNA ptr;
+  modifier_panel_get_property_pointers(C, panel, NULL, &ptr);
+
+  int profile_type = RNA_enum_get(&ptr, "profile_type");
+  int miter_inner = RNA_enum_get(&ptr, "miter_inner");
+  int miter_outer = RNA_enum_get(&ptr, "miter_outer");
+  bool edge_bevel = RNA_enum_get(&ptr, "affect") != MOD_BEVEL_VERT;
+
+  uiItemR(layout, &ptr, "profile_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
+
+  uiLayoutSetPropSep(layout, true);
+
+  if (ELEM(profile_type, MOD_BEVEL_PROFILE_SUPERELLIPSE, MOD_BEVEL_PROFILE_CUSTOM)) {
+    row = uiLayoutRow(layout, false);
+    uiLayoutSetActive(
+        row,
+        profile_type == MOD_BEVEL_PROFILE_SUPERELLIPSE ||
+            (profile_type == MOD_BEVEL_PROFILE_CUSTOM && edge_bevel &&
+             !((miter_inner == MOD_BEVEL_MITER_SHARP) && (miter_outer == MOD_BEVEL_MITER_SHARP))));
+    uiItemR(row,
+            &ptr,
+            "profile",
+            UI_ITEM_R_SLIDER,
+            (profile_type == MOD_BEVEL_PROFILE_SUPERELLIPSE) ? IFACE_("Shape") :
+                                                               IFACE_("Miter Shape"),
+            ICON_NONE);
+
+    if (profile_type == MOD_BEVEL_PROFILE_CUSTOM) {
+      uiLayout *sub = uiLayoutColumn(layout, false);
+      uiLayoutSetPropDecorate(sub, false);
+      uiTemplateCurveProfile(sub, &ptr, "custom_profile");
+    }
+  }
+}
+
 static void geometry_panel_draw(const bContext *C, Panel *panel)
 {
+  uiLayout *row;
   uiLayout *layout = panel->layout;
 
   PointerRNA ptr;
   modifier_panel_get_property_pointers(C, panel, NULL, &ptr);
 
+  bool edge_bevel = RNA_enum_get(&ptr, "affect") != MOD_BEVEL_VERT;
+
   uiLayoutSetPropSep(layout, true);
 
-  uiItemR(layout, &ptr, "miter_inner", 0, IFACE_("Miter Inner"), ICON_NONE);
-  uiItemR(layout, &ptr, "miter_outer", 0, IFACE_("Outer"), ICON_NONE);
+  row = uiLayoutRow(layout, false);
+  uiLayoutSetActive(row, edge_bevel);
+  uiItemR(row, &ptr, "miter_outer", 0, IFACE_("Miter Outer"), ICON_NONE);
+  row = uiLayoutRow(layout, false);
+  uiLayoutSetActive(row, edge_bevel);
+  uiItemR(row, &ptr, "miter_inner", 0, IFACE_("Inner"), ICON_NONE);
   if (RNA_enum_get(&ptr, "miter_inner") == BEVEL_MITER_ARC) {
-    uiItemR(layout, &ptr, "spread", 0, NULL, ICON_NONE);
+    row = uiLayoutRow(layout, false);
+    uiLayoutSetActive(row, edge_bevel);
+    uiItemR(row, &ptr, "spread", 0, NULL, ICON_NONE);
   }
   uiItemS(layout);
 
-  uiItemR(layout, &ptr, "vmesh_method", 0, IFACE_("Intersections"), ICON_NONE);
+  row = uiLayoutRow(layout, false);
+  uiLayoutSetActive(row, edge_bevel);
+  uiItemR(row, &ptr, "vmesh_method", 0, IFACE_("Intersections"), ICON_NONE);
   uiItemR(layout, &ptr, "use_clamp_overlap", 0, NULL, ICON_NONE);
-  uiItemR(layout, &ptr, "loop_slide", 0, NULL, ICON_NONE);
+  row = uiLayoutRow(layout, false);
+  uiLayoutSetActive(row, edge_bevel);
+  uiItemR(row, &ptr, "loop_slide", 0, NULL, ICON_NONE);
 }
 
 static void shading_panel_draw(const bContext *C, Panel *panel)
@@ -362,11 +402,14 @@ static void shading_panel_draw(const bContext *C, Panel *panel)
   PointerRNA ptr;
   modifier_panel_get_property_pointers(C, panel, NULL, &ptr);
 
+  bool edge_bevel = RNA_enum_get(&ptr, "affect") != MOD_BEVEL_VERT;
+
   uiLayoutSetPropSep(layout, true);
 
   uiItemR(layout, &ptr, "harden_normals", 0, NULL, ICON_NONE);
 
   col = uiLayoutColumnWithHeading(layout, true, IFACE

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list