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:
-rw-r--r--release/scripts/startup/bl_ui/space_view3d.py8
-rw-r--r--release/scripts/startup/bl_ui/space_view3d_toolbar.py28
2 files changed, 34 insertions, 2 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py
index 0c3d9ec7524..a1967d63d2e 100644
--- a/release/scripts/startup/bl_ui/space_view3d.py
+++ b/release/scripts/startup/bl_ui/space_view3d.py
@@ -140,8 +140,12 @@ class VIEW3D_HT_tool_header(Header):
_row, sub = row_for_mirror()
sub.prop(context.object.pose, "use_mirror_x", text="X", toggle=True)
elif mode_string == 'PAINT_WEIGHT':
- _row, sub = row_for_mirror()
- sub.prop(context.object.data, "use_mirror_x", text="X", toggle=True)
+ 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
diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 70904111b10..718365ec99d 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1471,6 +1471,32 @@ class VIEW3D_PT_tools_brush_display_custom_icon(Panel, View3DPaintPanel):
# TODO, move to space_view3d.py
+class VIEW3D_PT_tools_weightpaint_symmetry(Panel, View3DPaintPanel):
+ bl_context = ".weightpaint"
+ bl_options = {'DEFAULT_CLOSED'}
+ bl_label = "Symmetry"
+
+ @classmethod
+ def poll(cls, context):
+ # When used in the tool header, this is explicitly included next to the XYZ symmetry buttons.
+ return (context.region.type != 'TOOL_HEADER')
+
+ def draw(self, context):
+ layout = self.layout
+ tool_settings = context.tool_settings
+ wpaint = tool_settings.weight_paint
+ draw_vpaint_symmetry(layout, wpaint)
+
+
+class VIEW3D_PT_tools_weightpaint_symmetry_for_topbar(Panel):
+ bl_space_type = 'TOPBAR'
+ bl_region_type = 'HEADER'
+ bl_label = "Symmetry"
+
+ draw = VIEW3D_PT_tools_weightpaint_symmetry.draw
+
+
+# TODO, move to space_view3d.py
class VIEW3D_PT_tools_weightpaint_options(Panel, View3DPaintPanel):
bl_context = ".weightpaint"
bl_label = "Options"
@@ -2256,6 +2282,8 @@ classes = (
VIEW3D_PT_sculpt_options,
VIEW3D_PT_sculpt_options_unified,
VIEW3D_PT_sculpt_options_gravity,
+ VIEW3D_PT_tools_weightpaint_symmetry,
+ VIEW3D_PT_tools_weightpaint_symmetry_for_topbar,
VIEW3D_PT_tools_weightpaint_options,
VIEW3D_PT_tools_weightpaint_options_unified,
VIEW3D_PT_tools_vertexpaint_symmetry,