[Bf-blender-cvs] [55955444c20] soc-2019-bevel-profiles: Bevel Tool and Modifier: Small UI changes
Hans Goudey
noreply at git.blender.org
Thu Aug 8 04:56:05 CEST 2019
Commit: 55955444c204648221cb06f4c854b197027c9c92
Author: Hans Goudey
Date: Wed Aug 7 22:54:39 2019 -0400
Branches: soc-2019-bevel-profiles
https://developer.blender.org/rB55955444c204648221cb06f4c854b197027c9c92
Bevel Tool and Modifier: Small UI changes
Tool: Don't expand miter options, optimization.
Modifier: Don't show profile widget when not using custom profile
===================================================================
M release/scripts/startup/bl_ui/properties_data_modifier.py
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 de5902e2a88..05182c57ece 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -177,11 +177,12 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
layout.row().prop(md, "use_custom_profile")
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)
+ 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)
def BOOLEAN(self, layout, _ob, md):
split = layout.split()
diff --git a/source/blender/editors/mesh/editmesh_bevel.c b/source/blender/editors/mesh/editmesh_bevel.c
index 0a79cfa8bb6..971ec57b59b 100644
--- a/source/blender/editors/mesh/editmesh_bevel.c
+++ b/source/blender/editors/mesh/editmesh_bevel.c
@@ -856,13 +856,9 @@ static void edbm_bevel_ui(bContext *C, wmOperator *op)
{
uiLayout *layout = op->layout;
uiLayout *row;
+ PointerRNA ptr, toolsettings_ptr;
- 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;
- RNA_pointer_create(&scene->id, &RNA_ToolSettings, scene->toolsettings, &toolsettings_ptr);
uiItemR(layout, &ptr, "offset_type", 0, NULL, ICON_NONE);
if (RNA_enum_get(&ptr, "offset_type") == BEVEL_AMT_PERCENT) {
@@ -883,26 +879,26 @@ static void edbm_bevel_ui(bContext *C, wmOperator *op)
uiItemR(layout, &ptr, "harden_normals", 0, NULL, ICON_NONE);
uiItemR(layout, &ptr, "material", 0, NULL, ICON_NONE);
+ uiItemR(layout, &ptr, "miter_outer", 0, NULL, ICON_NONE);
+ uiItemR(layout, &ptr, "miter_inner", 0, NULL, ICON_NONE);
+ if (RNA_enum_get(&ptr, "miter_inner") == BEVEL_MITER_ARC) {
+ uiItemR(layout, &ptr, "spread", 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);
- }
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")) {
+ /* Get an RNA pointer to ToolSettings to give to the profile widget template code */
+ Scene *scene = CTX_data_scene(C);
+ RNA_pointer_create(&scene->id, &RNA_ToolSettings, scene->toolsettings, &toolsettings_ptr);
uiTemplateProfileWidget(layout, &toolsettings_ptr, "prwdgt");
-
}
}
More information about the Bf-blender-cvs
mailing list