1 # SPDX-FileCopyrightText: 2017-2022 Blender Foundation
3 # SPDX-License-Identifier: GPL-2.0-or-later
6 from bpy
.types
import Menu
7 from . import utils_core
10 class MasterSymmetryMenu(Menu
):
11 bl_label
= "Symmetry Options"
12 bl_idname
= "VIEW3D_MT_sv3_master_symmetry_menu"
15 def poll(self
, context
):
16 return utils_core
.get_mode() in (
24 def draw(self
, context
):
27 if utils_core
.get_mode() == 'PARTICLE_EDIT':
28 layout
.row().prop(context
.active_object
.data
, "use_mirror_x",
29 text
="Mirror X", toggle
=True)
31 elif utils_core
.get_mode() == 'TEXTURE_PAINT':
32 layout
.row().prop(context
.active_object
, "use_mesh_mirror_x",
33 text
="Symmetry X", toggle
=True)
34 layout
.row().prop(context
.active_object
, "use_mesh_mirror_y",
35 text
="Symmetry Y", toggle
=True)
36 layout
.row().prop(context
.active_object
, "use_mesh_mirror_z",
37 text
="Symmetry Z", toggle
=True)
39 layout
.row().menu(SymmetryMenu
.bl_idname
)
40 layout
.row().menu(SymmetryRadialMenu
.bl_idname
)
42 if utils_core
.get_mode() == 'SCULPT':
43 layout
.row().prop(context
.tool_settings
.sculpt
, "use_symmetry_feather",
47 class SymmetryMenu(Menu
):
49 bl_idname
= "VIEW3D_MT_sv3_symmetry_menu"
51 def draw(self
, context
):
54 layout
.row().label(text
="Symmetry")
55 layout
.row().separator()
57 layout
.row().prop(context
.active_object
, "use_mesh_mirror_x",
58 text
="Symmetry X", toggle
=True)
59 layout
.row().prop(context
.active_object
, "use_mesh_mirror_y",
60 text
="Symmetry Y", toggle
=True)
61 layout
.row().prop(context
.active_object
, "use_mesh_mirror_z",
62 text
="Symmetry Z", toggle
=True)
65 class SymmetryRadialMenu(Menu
):
67 bl_idname
= "VIEW3D_MT_sv3_symmetry_radial_menu"
69 def draw(self
, context
):
72 layout
.row().label(text
="Radial")
73 layout
.row().separator()
75 mode_tool_settings
= getattr(context
.tool_settings
, utils_core
.get_mode().lower())
77 layout
.column().prop(mode_tool_settings
, "radial_symmetry", text
="", slider
=True)
88 bpy
.utils
.register_class(cls
)
92 bpy
.utils
.unregister_class(cls
)