[Bf-blender-cvs] [b7cf6f94afa] soc-2019-bevel-profiles: Bevel modifier / tool UI updates

Hans Goudey noreply at git.blender.org
Wed Aug 7 23:41:53 CEST 2019


Commit: b7cf6f94afa49e6b9fcb42a98e77165eae123b40
Author: Hans Goudey
Date:   Wed Aug 7 17:41:19 2019 -0400
Branches: soc-2019-bevel-profiles
https://developer.blender.org/rBb7cf6f94afa49e6b9fcb42a98e77165eae123b40

Bevel modifier / tool UI updates

Does not include hide-able custom profile.

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

M	release/scripts/startup/bl_ui/properties_data_modifier.py
M	source/blender/blenkernel/BKE_profile_widget.h
M	source/blender/editors/interface/interface_templates.c
M	source/blender/editors/mesh/editmesh_bevel.c

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

diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index 58d3a18e994..de5902e2a88 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -163,23 +163,25 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
         layout.label(text="Width Method:")
         layout.row().prop(md, "offset_type", expand=True)
 
-        layout.row().prop(md, "face_strength_mode", expand=False)
-
-        layout.label(text="Miter Patterns")
+#        layout.label(text="Miter Methods:")
         layout.row().prop(md, "miter_outer")
         layout.row().prop(md, "miter_inner")
         if md.miter_inner == 'MITER_PATCH' or md.miter_inner == 'MITER_ARC':
             layout.row().prop(md, "spread")
 
-        layout.label(text="Vertex Mesh Method")
+        layout.label(text="Face Strength Mode:")
+        layout.row().prop(md, "face_strength_mode", expand=True)
+
+        layout.label(text="Intersection Method:")
         layout.row().prop(md, "vmesh_method", expand=True)
         layout.row().prop(md, "use_custom_profile")
-        if md.use_custom_profile:
-            layout.template_profilewidget(md, "prwdgt")
-            # If the number of segments has changed update the table to show the new sampled
-            # segment locations on the widget
-            if md.prwdgt.totsegments != md.segments:
-                md.prwdgt.initialize(md.segments)
+        row = layout.row()
+        row.enabled = md.use_custom_profile
+        layout.template_profilewidget(md, "prwdgt")
+        # If the number of segments has changed update the table to show the new sampled
+        # segment locations on the widget
+        if md.prwdgt.totsegments != md.segments:
+            md.prwdgt.initialize(md.segments)
 
     def BOOLEAN(self, layout, _ob, md):
         split = layout.split()
diff --git a/source/blender/blenkernel/BKE_profile_widget.h b/source/blender/blenkernel/BKE_profile_widget.h
index 524f1e09d61..13f9cc332a8 100644
--- a/source/blender/blenkernel/BKE_profile_widget.h
+++ b/source/blender/blenkernel/BKE_profile_widget.h
@@ -52,9 +52,9 @@ void BKE_profilewidget_reverse(struct ProfileWidget *prwdgt);
 void BKE_profilewidget_reset(struct ProfileWidget *prwdgt);
 
 void BKE_profilewidget_create_samples(struct ProfileWidget *prwdgt,
-                                  int n_segments,
-                                  bool sample_straight_edges,
-                                  struct ProfilePoint *r_samples);
+                                      int n_segments,
+                                      bool sample_straight_edges,
+                                      struct ProfilePoint *r_samples);
 
 void BKE_profilewidget_initialize(struct ProfileWidget *prwdgt, short nsegments);
 
@@ -65,12 +65,12 @@ void BKE_profilewidget_changed(struct ProfileWidget *prwdgt, const bool rem_doub
 float BKE_profilewidget_total_length(const struct ProfileWidget *prwdgt);
 
 void BKE_profilewidget_create_samples_even_spacing(const struct ProfileWidget *prwdgt,
-                                               double *x_table_out,
-                                               double *y_table_out);
+                                                   double *x_table_out,
+                                                   double *y_table_out);
 
 /* Length portion is the fraction of the total path length where we want the location */
 void BKE_profilewidget_evaluate_length_portion(const struct ProfileWidget *prwdgt,
-                                    float length_portion,
-                                    float *x_out,
-                                    float *y_out);
+                                               float length_portion,
+                                               float *x_out,
+                                               float *y_out);
 #endif
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 113b62111d4..36b9d40431d 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -4329,6 +4329,7 @@ static uiBlock *profilewidget_presets_func(bContext *C, ARegion *ar, ProfileWidg
   uiBlock *block;
   short yco = 0;
   short menuwidth = 12 * UI_UNIT_X;
+  menuwidth = 0;
 
   block = UI_block_begin(C, ar, __func__, UI_EMBOSS);
   UI_block_func_butmenu_set(block, profilewidget_presets_dofunc, prwdgt);
@@ -4548,7 +4549,7 @@ static void profilewidget_buttons_layout(uiLayout *layout, PointerRNA *ptr, RNAU
   /* HANS-QUESTION: I'm guessing this is the newer way to do this. I'd be happy to switch
    * everythingn here to this method, as it seems simpler, more elegant, and more linked to the RNA
    * system anyway, but this doesn't redraw the widget
-  uiItemR(layout, ptr, "preset", 0, "Preset", ICON_NONE); */
+  uiItemR(layout, ptr, "preset", 0, "Preset", ICON_NONE);*/
 
   row = uiLayoutRow(layout, false);
 
@@ -4570,7 +4571,7 @@ static void profilewidget_buttons_layout(uiLayout *layout, PointerRNA *ptr, RNAU
   sub = uiLayoutRow(row, true);
   uiLayoutSetAlignment(sub, UI_LAYOUT_ALIGN_RIGHT);
 
-  /* Reset view, vector handle, auto handle, auto clamped handle, reset curve */
+  /* Reset view, reset curve */
   bt = uiDefIconBlockBut(block, profilewidget_buttons_tools, prwdgt, 0, 0, 0, 0, UI_UNIT_X,
                          UI_UNIT_X, TIP_("Tools"));
   UI_but_funcN_set(bt, rna_update_cb, MEM_dupallocN(cb), NULL);
diff --git a/source/blender/editors/mesh/editmesh_bevel.c b/source/blender/editors/mesh/editmesh_bevel.c
index 9b6869b8353..0a79cfa8bb6 100644
--- a/source/blender/editors/mesh/editmesh_bevel.c
+++ b/source/blender/editors/mesh/editmesh_bevel.c
@@ -855,10 +855,10 @@ static int edbm_bevel_modal(bContext *C, wmOperator *op, const wmEvent *event)
 static void edbm_bevel_ui(bContext *C, wmOperator *op)
 {
   uiLayout *layout = op->layout;
+  uiLayout *row;
 
   PointerRNA ptr;
   RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr);
-
   /* Get an RNA pointer to ToolSettings to give to the profile widget template code */
   Scene *scene = CTX_data_scene(C);
   PointerRNA toolsettings_ptr;
@@ -873,24 +873,32 @@ static void edbm_bevel_ui(bContext *C, wmOperator *op)
   }
   uiItemR(layout, &ptr, "segments", 0, NULL, ICON_NONE);
   if (!RNA_boolean_get(&ptr, "use_custom_profile")) {
-    uiItemR(layout, &ptr, "profile", 0, NULL, ICON_NONE);
+    uiItemR(layout, &ptr, "profile", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
   }
   uiItemR(layout, &ptr, "vertex_only", 0, NULL, ICON_NONE);
   uiItemR(layout, &ptr, "clamp_overlap", 0, NULL, ICON_NONE);
   uiItemR(layout, &ptr, "loop_slide", 0, NULL, ICON_NONE);
   uiItemR(layout, &ptr, "mark_seam", 0, NULL, ICON_NONE);
   uiItemR(layout, &ptr, "mark_sharp", 0, NULL, ICON_NONE);
-  uiItemR(layout, &ptr, "material", 0, NULL, ICON_NONE);
   uiItemR(layout, &ptr, "harden_normals", 0, NULL, ICON_NONE);
-  if (RNA_boolean_get(&ptr, "harden_normals")) {
-    uiItemR(layout, &ptr, "face_strength_mode", 0, NULL, ICON_NONE);
-  }
-  uiItemR(layout, &ptr, "miter_outer", 0, NULL, ICON_NONE);
-  uiItemR(layout, &ptr, "miter_inner", 0, NULL, ICON_NONE);
+  uiItemR(layout, &ptr, "material", 0, NULL, ICON_NONE);
+
+  uiItemL(layout, "Face Strength Mode:", ICON_NONE);
+  row = uiLayoutRow(layout, true);
+  uiItemR(row, &ptr, "face_strength_mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
+
+  uiItemL(layout, "Outer Miter:", ICON_NONE);
+  row = uiLayoutRow(layout, true);
+  uiItemR(row, &ptr, "miter_outer", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
+  uiItemL(layout, "Inner Miter:", ICON_NONE);
+  row = uiLayoutRow(layout, true);
+  uiItemR(row, &ptr, "miter_inner", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
   if (RNA_enum_get(&ptr, "miter_inner") == BEVEL_MITER_ARC) {
     uiItemR(layout, &ptr, "spread", 0, NULL, ICON_NONE);
   }
-  uiItemR(layout, &ptr, "vmesh_method", 0, NULL, ICON_NONE);
+  uiItemL(layout, "Intersection Method:", ICON_NONE);
+  row = uiLayoutRow(layout, true);
+  uiItemR(row, &ptr, "vmesh_method", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
   uiItemR(layout, &ptr, "use_custom_profile", 0, NULL, ICON_NONE);
   if (RNA_boolean_get(&ptr, "use_custom_profile")) {
     uiTemplateProfileWidget(layout, &toolsettings_ptr, "prwdgt");



More information about the Bf-blender-cvs mailing list