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:
authorPablo Dobarro <pablodp606@gmail.com>2020-09-18 20:58:48 +0300
committerPablo Dobarro <pablodp606@gmail.com>2020-09-18 20:58:58 +0300
commit5502517c3c12086c111ae5477fae9c0d2eb8a84c (patch)
tree07a1978b5b81b5c1679a002111457acf73561a37 /release/scripts/startup/bl_ui/space_view3d.py
parent827dfd76dddec962e67825815931d4f2953c741b (diff)
Unify all XYZ symmetry options using Mesh Symmetry
This adds XYZ symmetry as a property of meshes and updates all modes to use the mesh symmetry by default to have a consistent tool behavior between all modes and when switching objects. Reviewed By: brecht, mano-wii, campbellbarton Maniphest Tasks: T79785 Differential Revision: https://developer.blender.org/D8587
Diffstat (limited to 'release/scripts/startup/bl_ui/space_view3d.py')
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py50
1 files changed, 15 insertions, 35 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 9cf61dc297a..40f03c88743 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -152,47 +152,27 @@ class VIEW3D_HT_tool_header(Header):
sub.scale_x = 0.6
return row, sub
- if mode_string == 'EDIT_MESH':
- _row, sub = row_for_mirror()
- sub.prop(context.object.data, "use_mirror_x", text="X", toggle=True)
- sub.prop(context.object.data, "use_mirror_y", text="Y", toggle=True)
- sub.prop(context.object.data, "use_mirror_z", text="Z", toggle=True)
- tool_settings = context.tool_settings
- layout.prop(tool_settings, "use_mesh_automerge", text="")
- elif mode_string == 'EDIT_ARMATURE':
+ if mode_string == 'EDIT_ARMATURE':
_row, sub = row_for_mirror()
sub.prop(context.object.data, "use_mirror_x", text="X", toggle=True)
elif mode_string == 'POSE':
_row, sub = row_for_mirror()
sub.prop(context.object.pose, "use_mirror_x", text="X", toggle=True)
- elif mode_string == 'PAINT_WEIGHT':
+ elif mode_string in {'EDIT_MESH', 'PAINT_WEIGHT', 'SCULPT', 'PAINT_VERTEX'}:
+ # Mesh Modes, Use Mesh Symmetry
row, sub = row_for_mirror()
- wpaint = context.tool_settings.weight_paint
- sub.prop(wpaint, "use_symmetry_x", text="X", toggle=True)
- sub.prop(wpaint, "use_symmetry_y", text="Y", toggle=True)
- sub.prop(wpaint, "use_symmetry_z", text="Z", toggle=True)
- row.popover(panel="VIEW3D_PT_tools_weightpaint_symmetry_for_topbar", text="")
- elif mode_string == 'SCULPT':
- row, 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)
- row.popover(panel="VIEW3D_PT_sculpt_symmetry_for_topbar", text="")
- elif mode_string == 'PAINT_TEXTURE':
- _row, 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)
- # No need for a popover, the panel only has these options.
- elif mode_string == 'PAINT_VERTEX':
- row, 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)
- row.popover(panel="VIEW3D_PT_tools_vertexpaint_symmetry_for_topbar", text="")
+ sub.prop(context.object.data, "use_mirror_x", text="X", toggle=True)
+ sub.prop(context.object.data, "use_mirror_y", text="Y", toggle=True)
+ sub.prop(context.object.data, "use_mirror_z", text="Z", toggle=True)
+ if mode_string == 'EDIT_MESH':
+ tool_settings = context.tool_settings
+ layout.prop(tool_settings, "use_mesh_automerge", text="")
+ elif mode_string == 'PAINT_WEIGHT':
+ row.popover(panel="VIEW3D_PT_tools_weightpaint_symmetry_for_topbar", text="")
+ elif mode_string == 'SCULPT':
+ row.popover(panel="VIEW3D_PT_sculpt_symmetry_for_topbar", text="")
+ elif mode_string == 'PAINT_VERTEX':
+ row.popover(panel="VIEW3D_PT_tools_vertexpaint_symmetry_for_topbar", text="")
# Expand panels from the side-bar as popovers.
popover_kw = {"space_type": 'VIEW_3D', "region_type": 'UI', "category": "Tool"}