1 # SPDX-FileCopyrightText: 2019-2023 Blender Foundation
3 # SPDX-License-Identifier: GPL-2.0-or-later
6 from bpy
.types
import (
10 from bpy
.props
import (
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
):
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"
32 class VIEW3D_MT_Edit_Armature(Menu
):
35 def draw(self
, context
):
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")
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")
54 layout
.operator("armature.delete")
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
):
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")
72 layout
.menu("VIEW3D_MT_edit_armature_delete")
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
):
85 def draw(self
, context
):
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")
93 layout
.menu("VIEW3D_MT_pose_group")
94 layout
.menu("VIEW3D_MT_object_parent")
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'
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
):
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
):
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")
138 VIEW3D_MT_Edit_Armature
,
139 VIEW3D_MT_EditArmatureTK
,
140 VIEW3D_MT_InteractiveModeArmature
,
144 # Register Classes & Hotkeys #
147 bpy
.utils
.register_class(cls
)
150 # Unregister Classes & Hotkeys #
153 for cls
in reversed(classes
):
154 bpy
.utils
.unregister_class(cls
)
157 if __name__
== "__main__":