Import_3ds: Improved distance cue node setup
[blender-addons.git] / space_view3d_spacebar_menu / transform_menus.py
blobff6cb4a18af050dffca0f22a78d1865fecd9fc0e
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,
15 from .object_menus import *
18 # Transform Menu's #
19 class VIEW3D_MT_TransformMenu(Menu):
20 bl_label = "Transform"
22 def draw(self, context):
23 layout = self.layout
24 layout.operator("transform.translate", text="Move")
25 layout.operator("transform.rotate", text="Rotate")
26 layout.operator("transform.resize", text="Scale")
27 layout.separator()
28 layout.menu("VIEW3D_MT_object_clear")
29 layout.menu("VIEW3D_MT_object_apply")
30 layout.separator()
31 layout.operator("transform.translate", text="Move Texture Space").texture_space = True
32 layout.operator("transform.resize", text="Scale Texture Space").texture_space = True
33 layout.separator()
34 layout.operator("object.randomize_transform")
35 layout.operator("transform.tosphere", text="To Sphere")
36 layout.operator("transform.shear", text="Shear")
37 layout.operator("transform.bend", text="Bend")
38 layout.operator("transform.push_pull", text="Push/Pull")
39 layout.separator()
40 layout.operator("object.align")
41 layout.operator_context = 'EXEC_REGION_WIN'
42 layout.operator("transform.transform",
43 text="Align to Transform Orientation").mode = 'ALIGN'
46 # ********** Transform Lite/Short **********
47 class VIEW3D_MT_TransformMenuLite(Menu):
48 bl_label = "Transform"
50 def draw(self, context):
51 layout = self.layout
52 layout.operator("transform.translate", text="Move")
53 layout.operator("transform.rotate", text="Rotate")
54 layout.operator("transform.resize", text="Scale")
55 layout.separator()
56 layout.menu("VIEW3D_MT_object_clear")
57 layout.menu("VIEW3D_MT_object_apply")
58 layout.separator()
59 layout.operator("transform.transform",
60 text="Align to Transform Orientation").mode = 'ALIGN'
61 layout.separator()
62 layout.operator("object.align")
63 layout.operator_context = 'EXEC_REGION_WIN'
64 layout.operator("transform.transform",
65 text="Align to Transform Orientation").mode = 'ALIGN'
67 # ********** Transform Camera **********
68 class VIEW3D_MT_TransformMenuCamera(Menu):
69 bl_label = "Transform"
71 def draw(self, context):
72 layout = self.layout
73 layout.menu("VIEW3D_MT_object_clear")
74 layout.menu("VIEW3D_MT_object_apply")
75 layout.operator("transform.translate", text="Move")
76 layout.operator("transform.rotate", text="Rotate")
77 layout.operator("transform.resize", text="Scale")
78 layout.operator("object.align")
79 layout.operator_context = 'EXEC_REGION_WIN'
80 layout.separator()
81 layout.operator("transform.transform",
82 text="Align to Transform Orientation").mode = 'ALIGN'
85 # ********** Transform Armature **********
86 class VIEW3D_MT_TransformMenuArmature(Menu):
87 bl_label = "Transform"
89 def draw(self, context):
90 layout = self.layout
91 layout.operator("transform.translate", text="Move")
92 layout.operator("transform.rotate", text="Rotate")
93 layout.operator("transform.resize", text="Scale")
94 layout.separator()
95 layout.operator("armature.align")
96 layout.operator("object.align")
97 layout.operator_context = 'EXEC_AREA'
98 layout.separator()
99 layout.operator("object.origin_set",
100 text="Geometry to Origin").type = 'GEOMETRY_ORIGIN'
101 layout.operator("object.origin_set",
102 text="Origin to Geometry").type = 'ORIGIN_GEOMETRY'
103 layout.operator("object.origin_set",
104 text="Origin to 3D Cursor").type = 'ORIGIN_CURSOR'
105 layout.operator("object.origin_set",
106 text="Origin to Center of Mass").type = 'ORIGIN_CENTER_OF_MASS'
109 # List The Classes #
111 classes = (
112 VIEW3D_MT_TransformMenu,
113 VIEW3D_MT_TransformMenuArmature,
114 VIEW3D_MT_TransformMenuLite,
115 VIEW3D_MT_TransformMenuCamera,
119 # Register Classes & Hotkeys #
120 def register():
121 for cls in classes:
122 bpy.utils.register_class(cls)
125 # Unregister Classes & Hotkeys #
126 def unregister():
128 for cls in reversed(classes):
129 bpy.utils.unregister_class(cls)
132 if __name__ == "__main__":
133 register()