1 # ##### BEGIN GPL LICENSE BLOCK #####
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software Foundation,
15 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 # ##### END GPL LICENSE BLOCK #####
18 # Contributed to by: meta-androcto, JayDez, sim88, sam, lijenstina, mkb, wisaac, CoDEmanX #
22 from bpy
.types
import (
26 from bpy
.props
import (
31 from .object_menus
import *
35 class VIEW3D_MT_TransformMenu(Menu
):
36 bl_label
= "Transform"
38 def draw(self
, context
):
40 layout
.operator("transform.translate", text
="Move")
41 layout
.operator("transform.rotate", text
="Rotate")
42 layout
.operator("transform.resize", text
="Scale")
44 layout
.menu("VIEW3D_MT_object_clear")
45 layout
.menu("VIEW3D_MT_object_apply")
47 layout
.operator("transform.translate", text
="Move Texture Space").texture_space
= True
48 layout
.operator("transform.resize", text
="Scale Texture Space").texture_space
= True
50 layout
.operator("object.randomize_transform")
51 layout
.operator("transform.tosphere", text
="To Sphere")
52 layout
.operator("transform.shear", text
="Shear")
53 layout
.operator("transform.bend", text
="Bend")
54 layout
.operator("transform.push_pull", text
="Push/Pull")
56 layout
.operator("object.align")
57 layout
.operator_context
= 'EXEC_REGION_WIN'
58 layout
.operator("transform.transform",
59 text
="Align to Transform Orientation").mode
= 'ALIGN'
62 # ********** Transform Lite/Short **********
63 class VIEW3D_MT_TransformMenuLite(Menu
):
64 bl_label
= "Transform"
66 def draw(self
, context
):
68 layout
.operator("transform.translate", text
="Move")
69 layout
.operator("transform.rotate", text
="Rotate")
70 layout
.operator("transform.resize", text
="Scale")
72 layout
.menu("VIEW3D_MT_object_clear")
73 layout
.menu("VIEW3D_MT_object_apply")
75 layout
.operator("transform.transform",
76 text
="Align to Transform Orientation").mode
= 'ALIGN'
78 layout
.operator("object.align")
79 layout
.operator_context
= 'EXEC_REGION_WIN'
80 layout
.operator("transform.transform",
81 text
="Align to Transform Orientation").mode
= 'ALIGN'
83 # ********** Transform Camera **********
84 class VIEW3D_MT_TransformMenuCamera(Menu
):
85 bl_label
= "Transform"
87 def draw(self
, context
):
89 layout
.menu("VIEW3D_MT_object_clear")
90 layout
.menu("VIEW3D_MT_object_apply")
91 layout
.operator("transform.translate", text
="Move")
92 layout
.operator("transform.rotate", text
="Rotate")
93 layout
.operator("transform.resize", text
="Scale")
94 layout
.operator("object.align")
95 layout
.operator_context
= 'EXEC_REGION_WIN'
97 layout
.operator("transform.transform",
98 text
="Align to Transform Orientation").mode
= 'ALIGN'
101 # ********** Transform Armature **********
102 class VIEW3D_MT_TransformMenuArmature(Menu
):
103 bl_label
= "Transform"
105 def draw(self
, context
):
107 layout
.operator("transform.translate", text
="Move")
108 layout
.operator("transform.rotate", text
="Rotate")
109 layout
.operator("transform.resize", text
="Scale")
111 layout
.operator("armature.align")
112 layout
.operator("object.align")
113 layout
.operator_context
= 'EXEC_AREA'
115 layout
.operator("object.origin_set",
116 text
="Geometry to Origin").type = 'GEOMETRY_ORIGIN'
117 layout
.operator("object.origin_set",
118 text
="Origin to Geometry").type = 'ORIGIN_GEOMETRY'
119 layout
.operator("object.origin_set",
120 text
="Origin to 3D Cursor").type = 'ORIGIN_CURSOR'
121 layout
.operator("object.origin_set",
122 text
="Origin to Center of Mass").type = 'ORIGIN_CENTER_OF_MASS'
128 VIEW3D_MT_TransformMenu
,
129 VIEW3D_MT_TransformMenuArmature
,
130 VIEW3D_MT_TransformMenuLite
,
131 VIEW3D_MT_TransformMenuCamera
,
135 # Register Classes & Hotkeys #
138 bpy
.utils
.register_class(cls
)
141 # Unregister Classes & Hotkeys #
144 for cls
in reversed(classes
):
145 bpy
.utils
.unregister_class(cls
)
148 if __name__
== "__main__":