Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2019-05-21 08:04:21 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-05-21 08:18:17 +0300
commit909c0bd0433222bcdb8661c3ecdf6026150557f0 (patch)
tree01a00e1ada83dd63f0e5839c0f591c86dc805158
parent6640bcca742210fa3dc9c8a0675ebf71a9e9e7f6 (diff)
UI: expose mirror/symmetry options int the tob-bar
D4895 by @billreynish with edits.
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py76
-rw-r--r--release/scripts/startup/bl_ui/space_view3d_toolbar.py2
-rw-r--r--source/blender/makesrna/intern/rna_scene.c1
3 files changed, 58 insertions, 21 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 782bf016b2a..5b8daa7ebea 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -115,40 +115,76 @@ class VIEW3D_HT_tool_header(Header):
def draw_mode_settings(self, context):
layout = self.layout
+ mode_string = context.mode
- # Active Tool
- # -----------
- from .space_toolsystem_common import ToolSelectPanelHelper
- tool = ToolSelectPanelHelper.tool_active_from_context(context)
- tool_mode = context.mode if tool is None else tool.mode
-
- if tool_mode == 'SCULPT':
+ def row_for_mirror():
+ row = layout.row(align=True)
+ row.label(icon='MOD_MIRROR')
+ sub = row.row(align=True)
+ sub.scale_x = 0.6
+ return sub
+
+ if mode_string == 'EDIT_MESH':
+ sub = row_for_mirror()
+ sub.prop(context.object.data, "use_mirror_x", text="X", toggle=True)
+ tool_settings = context.tool_settings
+ layout.prop(tool_settings, "use_mesh_automerge", text="")
+ elif mode_string == 'EDIT_ARMATURE':
+ sub = row_for_mirror()
+ sub.prop(context.object.data, "use_mirror_x", text="X", toggle=True)
+ elif mode_string == 'POSE':
+ sub = row_for_mirror()
+ sub.prop(context.object.pose, "use_mirror_x", text="X", toggle=True)
+ elif mode_string == 'PAINT_WEIGHT':
+ sub = row_for_mirror()
+ sub.prop(context.object.data, "use_mirror_x", text="X", toggle=True)
+ elif mode_string == 'SCULPT':
+ sub = row_for_mirror()
+ sculpt = context.tool_settings.sculpt
+ sub.prop(sculpt, "use_symmetry_x", text="X", toggle=True)
+ sub.prop(sculpt, "use_symmetry_y", text="Y", toggle=True)
+ sub.prop(sculpt, "use_symmetry_z", text="Z", toggle=True)
+ elif mode_string == 'PAINT_TEXTURE':
+ sub = row_for_mirror()
+ ipaint = context.tool_settings.image_paint
+ sub.prop(ipaint, "use_symmetry_x", text="X", toggle=True)
+ sub.prop(ipaint, "use_symmetry_y", text="Y", toggle=True)
+ sub.prop(ipaint, "use_symmetry_z", text="Z", toggle=True)
+ elif mode_string == 'PAINT_VERTEX':
+ sub = row_for_mirror()
+ vpaint = context.tool_settings.vertex_paint
+ sub.prop(vpaint, "use_symmetry_x", text="X", toggle=True)
+ sub.prop(vpaint, "use_symmetry_y", text="Y", toggle=True)
+ sub.prop(vpaint, "use_symmetry_z", text="Z", toggle=True)
+
+ # Expand panels from the side-bar as popovers.
+ if mode_string == 'SCULPT':
layout.popover_group(space_type='VIEW_3D', region_type='UI', context=".sculpt_mode", category="Tool")
- elif tool_mode == 'PAINT_VERTEX':
+ elif mode_string == 'PAINT_VERTEX':
layout.popover_group(space_type='VIEW_3D', region_type='UI', context=".vertexpaint", category="Tool")
- elif tool_mode == 'PAINT_WEIGHT':
+ elif mode_string == 'PAINT_WEIGHT':
layout.popover_group(space_type='VIEW_3D', region_type='UI', context=".weightpaint", category="Tool")
- elif tool_mode == 'PAINT_TEXTURE':
+ elif mode_string == 'PAINT_TEXTURE':
layout.popover_group(space_type='VIEW_3D', region_type='UI', context=".imagepaint", category="Tool")
- elif tool_mode == 'EDIT_TEXT':
+ elif mode_string == 'EDIT_TEXT':
layout.popover_group(space_type='VIEW_3D', region_type='UI', context=".text_edit", category="Tool")
- elif tool_mode == 'EDIT_ARMATURE':
+ elif mode_string == 'EDIT_ARMATURE':
layout.popover_group(space_type='VIEW_3D', region_type='UI', context=".armature_edit", category="Tool")
- elif tool_mode == 'EDIT_METABALL':
+ elif mode_string == 'EDIT_METABALL':
layout.popover_group(space_type='VIEW_3D', region_type='UI', context=".mball_edit", category="Tool")
- elif tool_mode == 'EDIT_LATTICE':
+ elif mode_string == 'EDIT_LATTICE':
layout.popover_group(space_type='VIEW_3D', region_type='UI', context=".lattice_edit", category="Tool")
- elif tool_mode == 'EDIT_CURVE':
+ elif mode_string == 'EDIT_CURVE':
layout.popover_group(space_type='VIEW_3D', region_type='UI', context=".curve_edit", category="Tool")
- elif tool_mode == 'EDIT_MESH':
+ elif mode_string == 'EDIT_MESH':
layout.popover_group(space_type='VIEW_3D', region_type='UI', context=".mesh_edit", category="Tool")
- elif tool_mode == 'POSE':
+ elif mode_string == 'POSE':
layout.popover_group(space_type='VIEW_3D', region_type='UI', context=".posemode", category="Tool")
- elif tool_mode == 'PARTICLE':
+ elif mode_string == 'PARTICLE':
layout.popover_group(space_type='VIEW_3D', region_type='UI', context=".particlemode", category="Tool")
- elif tool_mode == 'OBJECT':
+ elif mode_string == 'OBJECT':
layout.popover_group(space_type='VIEW_3D', region_type='UI', context=".objectmode", category="Tool")
- elif tool_mode in {'PAINT_GPENCIL', 'EDIT_GPENCIL', 'SCULPT_GPENCIL', 'WEIGHT_GPENCIL'}:
+ elif mode_string in {'PAINT_GPENCIL', 'EDIT_GPENCIL', 'SCULPT_GPENCIL', 'WEIGHT_GPENCIL'}:
# Grease pencil layer.
gpl = context.active_gpencil_layer
if gpl and gpl.info is not None:
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 91852aa8e57..d5b94156545 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -106,7 +106,7 @@ class VIEW3D_PT_tools_meshedit_options(View3DPanel, Panel):
row.prop(mesh, "use_mirror_topology")
layout.prop(tool_settings, "use_edge_path_live_unwrap")
- layout.prop(tool_settings, "use_mesh_automerge")
+ layout.prop(tool_settings, "use_mesh_automerge", toggle=False)
layout.prop(tool_settings, "double_threshold")
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index f861cf8cb1b..a4e060d55ef 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -2858,6 +2858,7 @@ static void rna_def_tool_settings(BlenderRNA *brna)
RNA_def_property_boolean_sdna(prop, NULL, "automerge", 0);
RNA_def_property_ui_text(
prop, "AutoMerge Editing", "Automatically merge vertices moved to the same location");
+ RNA_def_property_ui_icon(prop, ICON_AUTOMERGE_OFF, -1);
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL); /* header redraw */
prop = RNA_def_property(srna, "use_snap", PROP_BOOLEAN, PROP_NONE);