Export_3ds: Improved distance cue node search
[blender-addons.git] / space_view3d_brush_menus / symmetry_menu.py
blobfa6a02ced369b3c00a158c2cfef6dfb28751c88e
1 # SPDX-FileCopyrightText: 2017-2022 Blender Foundation
3 # SPDX-License-Identifier: GPL-2.0-or-later
5 import bpy
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"
14 @classmethod
15 def poll(self, context):
16 return utils_core.get_mode() in (
17 'SCULPT',
18 'VERTEX_PAINT',
19 'WEIGHT_PAINT',
20 'TEXTURE_PAINT',
21 'PARTICLE_EDIT',
24 def draw(self, context):
25 layout = self.layout
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)
38 else:
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",
44 toggle=True)
47 class SymmetryMenu(Menu):
48 bl_label = "Symmetry"
49 bl_idname = "VIEW3D_MT_sv3_symmetry_menu"
51 def draw(self, context):
52 layout = self.layout
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):
66 bl_label = "Radial"
67 bl_idname = "VIEW3D_MT_sv3_symmetry_radial_menu"
69 def draw(self, context):
70 layout = self.layout
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)
80 classes = (
81 MasterSymmetryMenu,
82 SymmetryMenu,
83 SymmetryRadialMenu
86 def register():
87 for cls in classes:
88 bpy.utils.register_class(cls)
90 def unregister():
91 for cls in classes:
92 bpy.utils.unregister_class(cls)