Import_3ds: Improved distance cue chunk import
[blender-addons.git] / space_view3d_spacebar_menu / armature_menus.py
blobe6db611095d54dace04f34b48bd18561c6623c77
1 # SPDX-FileCopyrightText: 2019-2023 Blender Foundation
3 # SPDX-License-Identifier: GPL-2.0-or-later
5 import bpy
6 from bpy.types import (
7 Operator,
8 Menu,
10 from bpy.props import (
11 BoolProperty,
12 StringProperty,
14 from .object_menus import *
16 # ********** Object Armature Interactive Mode **********
17 class VIEW3D_MT_InteractiveModeArmature(Menu):
18 bl_idname = "VIEW3D_MT_Object_Interactive_Armature"
19 bl_label = "Interactive Mode"
20 bl_description = "Menu of objects interactive mode"
22 def draw(self, context):
23 layout = self.layout
25 layout.operator(VIEW3D_OT_SetObjectMode.bl_idname, text="Object", icon="OBJECT_DATAMODE").mode = "OBJECT"
26 layout.operator(VIEW3D_OT_SetObjectMode.bl_idname, text="Edit", icon="EDITMODE_HLT").mode = "EDIT"
27 layout.operator(VIEW3D_OT_SetObjectMode.bl_idname, text="Pose", icon="POSE_HLT").mode = "POSE"
30 # Armature Menu's #
32 class VIEW3D_MT_Edit_Armature(Menu):
33 bl_label = "Armature"
35 def draw(self, context):
36 layout = self.layout
37 toolsettings = context.tool_settings
39 # layout.prop_menu_enum(toolsettings, "proportional_edit", icon="PROP_CON")
40 layout.prop_menu_enum(toolsettings, "proportional_edit_falloff", icon="SMOOTHCURVE")
41 layout.separator()
43 layout.menu("VIEW3D_MT_bone_options_toggle", text="Bone Settings")
44 layout.operator("armature.merge")
45 layout.operator("armature.fill")
46 layout.operator("armature.split")
47 layout.operator("armature.separate")
48 layout.operator("armature.switch_direction", text="Switch Direction")
50 layout.operator_context = 'EXEC_AREA'
51 layout.operator("armature.symmetrize")
52 layout.separator()
54 layout.operator("armature.delete")
55 layout.separator()
57 layout.operator_context = 'INVOKE_DEFAULT'
58 layout.operator("armature.armature_layers")
59 layout.operator("armature.bone_layers")
62 class VIEW3D_MT_EditArmatureTK(Menu):
63 bl_label = "Armature Tools"
65 def draw(self, context):
66 layout = self.layout
67 layout.operator("armature.subdivide", text="Subdivide")
68 layout.operator("armature.extrude_move")
69 layout.operator("armature.extrude_forked")
70 layout.operator("armature.duplicate_move")
71 layout.separator()
72 layout.menu("VIEW3D_MT_edit_armature_delete")
73 layout.separator()
74 layout.operator("transform.transform",
75 text="Scale Envelope Distance").mode = 'BONE_SIZE'
76 layout.operator("transform.transform",
77 text="Scale B-Bone Width").mode = 'BONE_SIZE'
80 # Armature Pose Menu's #
82 class VIEW3D_MT_Pose(Menu):
83 bl_label = "Pose"
85 def draw(self, context):
86 layout = self.layout
88 layout.menu("VIEW3D_MT_object_animation")
89 layout.menu("VIEW3D_MT_pose_slide")
90 layout.menu("VIEW3D_MT_pose_propagate")
91 layout.menu("VIEW3D_MT_pose_motion")
92 layout.separator()
93 layout.menu("VIEW3D_MT_pose_group")
94 layout.menu("VIEW3D_MT_object_parent")
95 layout.separator()
96 layout.menu("VIEW3D_MT_pose_ik")
97 layout.menu("VIEW3D_MT_pose_constraints")
98 layout.menu("VIEW3D_MT_PoseNames")
99 layout.operator("pose.quaternions_flip")
100 layout.operator_context = 'INVOKE_AREA'
101 layout.separator()
102 layout.menu("VIEW3D_MT_pose_showhide")
103 layout.menu("VIEW3D_MT_bone_options_toggle", text="Bone Settings")
106 class VIEW3D_MT_PoseCopy(Menu):
107 bl_label = "Pose Copy"
109 def draw(self, context):
110 layout = self.layout
111 layout.operator("pose.copy")
112 layout.operator("pose.paste")
113 layout.operator("pose.paste",
114 text="Paste X-Flipped Pose").flipped = True
117 class VIEW3D_MT_PoseNames(Menu):
118 bl_label = "Pose Names"
120 def draw(self, context):
121 layout = self.layout
122 layout.operator_context = 'EXEC_AREA'
123 layout.operator("pose.autoside_names",
124 text="AutoName Left/Right").axis = 'XAXIS'
125 layout.operator("pose.autoside_names",
126 text="AutoName Front/Back").axis = 'YAXIS'
127 layout.operator("pose.autoside_names",
128 text="AutoName Top/Bottom").axis = 'ZAXIS'
129 layout.operator("pose.flip_names")
132 # List The Classes #
134 classes = (
135 VIEW3D_MT_Pose,
136 VIEW3D_MT_PoseCopy,
137 VIEW3D_MT_PoseNames,
138 VIEW3D_MT_Edit_Armature,
139 VIEW3D_MT_EditArmatureTK,
140 VIEW3D_MT_InteractiveModeArmature,
144 # Register Classes & Hotkeys #
145 def register():
146 for cls in classes:
147 bpy.utils.register_class(cls)
150 # Unregister Classes & Hotkeys #
151 def unregister():
153 for cls in reversed(classes):
154 bpy.utils.unregister_class(cls)
157 if __name__ == "__main__":
158 register()