[Bf-blender-cvs] [8178044f64c] soc-2019-bevel-profiles: Unify Bevel Tool and Modifier UI:
Hans Goudey
noreply at git.blender.org
Fri Aug 9 14:52:20 CEST 2019
Commit: 8178044f64cec3c43d12da51e56327064fc44e61
Author: Hans Goudey
Date: Fri Aug 9 08:52:08 2019 -0400
Branches: soc-2019-bevel-profiles
https://developer.blender.org/rB8178044f64cec3c43d12da51e56327064fc44e61
Unify Bevel Tool and Modifier UI:
Includes final UI updates after feedback from the devtalk thread.
The two UIs are now unified except for options that aren't currently
in the tool such as "Limit Method"
===================================================================
M release/scripts/startup/bl_ui/properties_data_modifier.py
M source/blender/editors/mesh/editmesh_bevel.c
M source/blender/makesrna/intern/rna_modifier.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_data_modifier.py b/release/scripts/startup/bl_ui/properties_data_modifier.py
index 05182c57ece..cfe1d28c736 100644
--- a/release/scripts/startup/bl_ui/properties_data_modifier.py
+++ b/release/scripts/startup/bl_ui/properties_data_modifier.py
@@ -133,46 +133,48 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
layout.prop(md, "end_cap")
def BEVEL(self, layout, ob, md):
- split = layout.split()
-
- col = split.column()
if md.offset_type == 'PERCENT':
- col.prop(md, "width_pct")
+ layout.prop(md, "width_pct")
else:
- col.prop(md, "width")
- col.prop(md, "segments")
- col.prop(md, "profile")
- col.prop(md, "material")
+ offset_text = "Width"
+ if md.offset_type == 'DEPTH':
+ offset_text = "Depth"
+ elif md.offset_type == 'OFFSET':
+ offset_text = "Offset"
+ layout.prop(md, "width", text=offset_text)
+ layout.row().prop(md, "offset_type", expand=True)
+ split = layout.split()
col = split.column()
col.prop(md, "use_only_vertices")
col.prop(md, "use_clamp_overlap")
col.prop(md, "loop_slide")
+ col = split.column()
col.prop(md, "mark_seam")
col.prop(md, "mark_sharp")
col.prop(md, "harden_normals")
+ layout.row().prop(md, "segments")
+ layout.row().prop(md, "profile")
+ layout.row().prop(md, "material")
+
+ layout.label(text="Miter Type:")
+ layout.row().prop(md, "miter_outer", text="Outer")
+ layout.row().prop(md, "miter_inner", text="Inner")
+ if md.miter_inner == 'MITER_PATCH' or md.miter_inner == 'MITER_ARC':
+ layout.row().prop(md, "spread")
+
layout.label(text="Limit Method:")
layout.row().prop(md, "limit_method", expand=True)
if md.limit_method == 'ANGLE':
layout.prop(md, "angle_limit")
elif md.limit_method == 'VGROUP':
- layout.label(text="Vertex Group:")
layout.prop_search(md, "vertex_group", ob, "vertex_groups", text="")
- layout.label(text="Width Method:")
- layout.row().prop(md, "offset_type", expand=True)
-
-# 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="Face Strength Mode:")
layout.row().prop(md, "face_strength_mode", expand=True)
- layout.label(text="Intersection Method:")
+ layout.label(text="Intersection Type:")
layout.row().prop(md, "vmesh_method", expand=True)
layout.row().prop(md, "use_custom_profile")
row = layout.row()
diff --git a/source/blender/editors/mesh/editmesh_bevel.c b/source/blender/editors/mesh/editmesh_bevel.c
index 971ec57b59b..c711cb4bf7a 100644
--- a/source/blender/editors/mesh/editmesh_bevel.c
+++ b/source/blender/editors/mesh/editmesh_bevel.c
@@ -855,32 +855,39 @@ 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;
+ uiLayout *row, *col, *split;
PointerRNA ptr, toolsettings_ptr;
RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr);
- uiItemR(layout, &ptr, "offset_type", 0, NULL, ICON_NONE);
if (RNA_enum_get(&ptr, "offset_type") == BEVEL_AMT_PERCENT) {
uiItemR(layout, &ptr, "offset_pct", 0, NULL, ICON_NONE);
}
else {
uiItemR(layout, &ptr, "offset", 0, NULL, ICON_NONE);
}
+ row = uiLayoutRow(layout, true);
+ uiItemR(row, &ptr, "offset_type", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
+
+
+
uiItemR(layout, &ptr, "segments", 0, NULL, ICON_NONE);
- if (!RNA_boolean_get(&ptr, "use_custom_profile")) {
- 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, "harden_normals", 0, NULL, ICON_NONE);
+ uiItemR(layout, &ptr, "profile", UI_ITEM_R_SLIDER, 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);
+ split = uiLayoutSplit(layout, 0.5f, true);
+ col = uiLayoutColumn(split, true);
+ uiItemR(col, &ptr, "vertex_only", 0, NULL, ICON_NONE);
+ uiItemR(col, &ptr, "clamp_overlap", 0, NULL, ICON_NONE);
+ uiItemR(col, &ptr, "loop_slide", 0, NULL, ICON_NONE);
+ col = uiLayoutColumn(split, true);
+ uiItemR(col, &ptr, "mark_seam", 0, NULL, ICON_NONE);
+ uiItemR(col, &ptr, "mark_sharp", 0, NULL, ICON_NONE);
+ uiItemR(col, &ptr, "harden_normals", 0, NULL, ICON_NONE);
+
+ uiItemL(layout, "Miter Type:", ICON_NONE);
+ uiItemR(layout, &ptr, "miter_outer", 0, "Outer", ICON_NONE);
+ uiItemR(layout, &ptr, "miter_inner", 0, "Inner", ICON_NONE);
if (RNA_enum_get(&ptr, "miter_inner") == BEVEL_MITER_ARC) {
uiItemR(layout, &ptr, "spread", 0, NULL, ICON_NONE);
}
@@ -889,7 +896,7 @@ static void edbm_bevel_ui(bContext *C, wmOperator *op)
row = uiLayoutRow(layout, true);
uiItemR(row, &ptr, "face_strength_mode", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
- uiItemL(layout, "Intersection Method:", ICON_NONE);
+ uiItemL(layout, "Intersection Type:", ICON_NONE);
row = uiLayoutRow(layout, true);
uiItemR(row, &ptr, "vmesh_method", UI_ITEM_R_EXPAND, NULL, ICON_NONE);
diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c
index c92e0ac2ce3..aa5d748f7cf 100644
--- a/source/blender/makesrna/intern/rna_modifier.c
+++ b/source/blender/makesrna/intern/rna_modifier.c
@@ -3577,7 +3577,7 @@ static void rna_def_modifier_bevel(BlenderRNA *brna)
prop = RNA_def_property(srna, "offset_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "val_flags");
RNA_def_property_enum_items(prop, prop_val_type_items);
- RNA_def_property_ui_text(prop, "Amount Type", "What distance Width measures");
+ RNA_def_property_ui_text(prop, "Width Type", "What distance Width measures");
RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop = RNA_def_property(srna, "profile", PROP_FLOAT, PROP_FACTOR);
More information about the Bf-blender-cvs
mailing list