3 "name": "Manipulator Menu: Key: 'Ctrl Space'",
4 "description": "Manipulator Modes",
5 "author": "Antony Riakiotakis, Sebastian Koenig",
8 "location": "Ctrl Space",
15 from bpy
.types
import (
19 from bpy
.props
import (
24 # Pie Manipulator Mode - Ctrl Space
25 class VIEW3D_manipulator_set_of(Operator
):
26 bl_label
= "Set Manipulator"
27 bl_idname
= "view3d.manipulator_set"
31 items
=(('TRANSLATE', "Translate", "Use the manipulator for movement transformations"),
32 ('ROTATE', "Rotate", "Use the manipulator for rotation transformations"),
33 ('SCALE', "Scale", "Use the manipulator for scale transformations"),
37 def execute(self
, context
):
38 # show manipulator if user selects an option
39 context
.space_data
.show_manipulator
= True
40 context
.space_data
.transform_manipulators
= {self
.type}
45 class VIEW3D_PIE_manipulator_of(Menu
):
46 bl_label
= "Manipulator"
47 bl_idname
= "view3d.manipulator_of"
49 def draw(self
, context
):
52 pie
= layout
.menu_pie()
53 pie
.operator("wm.tool_set_by_name", icon
='MAN_TRANS', text
="Translate").name
= "Move"
54 pie
.operator("wm.tool_set_by_name", icon
='MAN_ROT', text
="Rotate").name
= "Rotate"
55 pie
.operator("wm.tool_set_by_name", icon
='MAN_SCALE', text
="Scale").name
= "Scale"
56 pie
.prop(context
.space_data
, "show_manipulator")
60 VIEW3D_manipulator_set_of
,
61 VIEW3D_PIE_manipulator_of
,
69 bpy
.utils
.register_class(cls
)
70 wm
= bpy
.context
.window_manager
72 if wm
.keyconfigs
.addon
:
74 km
= wm
.keyconfigs
.addon
.keymaps
.new(name
='Object Non-modal')
75 kmi
= km
.keymap_items
.new('wm.call_menu_pie', 'SPACE', 'PRESS', ctrl
=True)
76 kmi
.properties
.name
= "view3d.manipulator_of"
77 addon_keymaps
.append((km
, kmi
))
82 bpy
.utils
.unregister_class(cls
)
84 wm
= bpy
.context
.window_manager
85 kc
= wm
.keyconfigs
.addon
87 for km
, kmi
in addon_keymaps
:
88 km
.keymap_items
.remove(kmi
)
92 if __name__
== "__main__":