From fa9b05149c2ca3915a4fb2670c87a648d927336c Mon Sep 17 00:00:00 2001 From: Sebastian Parborg Date: Fri, 2 Apr 2021 14:44:26 +0200 Subject: 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 --- .../scripts/startup/bl_ui/space_view3d_toolbar.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'release/scripts/startup/bl_ui/space_view3d_toolbar.py') 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): -- cgit v1.2.3