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:
authorSebastian Parborg <darkdefende@gmail.com>2021-04-02 15:44:26 +0300
committerSebastian Parborg <darkdefende@gmail.com>2021-04-02 15:44:26 +0300
commitfa9b05149c2ca3915a4fb2670c87a648d927336c (patch)
treecd7e57cc72697b62260297b993507ff79a6114a9 /release/scripts/startup/bl_ui/space_view3d_toolbar.py
parente7a0a75919fd2e33869b4b8efbf0e69bf5904ea7 (diff)
Fix T84520: Make the different weight paint code paths exclusive to each other
Before this change, you could have the new sculpt symmetry code and the older weight paint symmetry code active at the same time. This would lead to users easily trashing their weigh paint data if they were not careful when switching between modes. Now the specific weight paint symmetry code is an exclusive toggle so the user can't accidentally mirror strokes and vertex groups at the same time. This also paves the way of supporting Y and Z symmetry in the future for weight groups mirroring if we decide to add it in the future. Reviewed By: Sybren Differential Revision: http://developer.blender.org/D10426
Diffstat (limited to 'release/scripts/startup/bl_ui/space_view3d_toolbar.py')
-rw-r--r--release/scripts/startup/bl_ui/space_view3d_toolbar.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 831fc06eda5..ab012a6f2ef 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -123,13 +123,15 @@ class View3DPanel:
# **************** standard tool clusters ******************
# Used by vertex & weight paint
-def draw_vpaint_symmetry(layout, vpaint, mesh):
+def draw_vpaint_symmetry(layout, vpaint, obj):
col = layout.column()
row = col.row(heading="Mirror", align=True)
- row.prop(mesh, "use_mirror_x", text="X", toggle=True)
- row.prop(mesh, "use_mirror_y", text="Y", toggle=True)
- row.prop(mesh, "use_mirror_z", text="Z", toggle=True)
+ row.prop(obj, "use_mesh_mirror_x", text="X", toggle=True)
+ row.prop(obj, "use_mesh_mirror_y", text="Y", toggle=True)
+ row.prop(obj, "use_mesh_mirror_z", text="Z", toggle=True)
+ col = layout.column()
+ col.active = not obj.data.use_mirror_vertex_groups
col.prop(vpaint, "radial_symmetry", text="Radial")
@@ -977,12 +979,12 @@ class VIEW3D_PT_tools_weightpaint_symmetry(Panel, View3DPaintPanel):
wpaint = tool_settings.weight_paint
mesh = context.object.data
- draw_vpaint_symmetry(layout, wpaint, mesh)
+ layout.prop(mesh, 'use_mirror_vertex_groups')
- col = layout.column(align=True)
- col.prop(mesh, 'use_mirror_vertex_group_x', text="Vertex Group X")
- row = col.row()
- row.active = mesh.use_mirror_vertex_group_x
+ draw_vpaint_symmetry(layout, wpaint, context.object)
+
+ row = layout.row()
+ row.active = mesh.use_mirror_vertex_groups
row.prop(mesh, "use_mirror_topology")
@@ -1057,7 +1059,7 @@ class VIEW3D_PT_tools_vertexpaint_symmetry(Panel, View3DPaintPanel):
tool_settings = context.tool_settings
vpaint = tool_settings.vertex_paint
- draw_vpaint_symmetry(layout, vpaint, context.object.data)
+ draw_vpaint_symmetry(layout, vpaint, context.object)
class VIEW3D_PT_tools_vertexpaint_symmetry_for_topbar(Panel):