Changeset View
Changeset View
Standalone View
Standalone View
pie_menus_official/pie_manipulator_of.py
| Show All 20 Lines | from bpy.props import ( | ||||
| ) | ) | ||||
| # Pie Manipulator Mode - Ctrl Space | # Pie Manipulator Mode - Ctrl Space | ||||
| class VIEW3D_manipulator_set_of(Operator): | class VIEW3D_manipulator_set_of(Operator): | ||||
| bl_label = "Set Manipulator" | bl_label = "Set Manipulator" | ||||
| bl_idname = "view3d.manipulator_set" | bl_idname = "view3d.manipulator_set" | ||||
| type = EnumProperty( | type: EnumProperty( | ||||
| name="Type", | name="Type", | ||||
| items=(('TRANSLATE', "Translate", "Use the manipulator for movement transformations"), | items=(('TRANSLATE', "Translate", "Use the manipulator for movement transformations"), | ||||
| ('ROTATE', "Rotate", "Use the manipulator for rotation transformations"), | ('ROTATE', "Rotate", "Use the manipulator for rotation transformations"), | ||||
| ('SCALE', "Scale", "Use the manipulator for scale transformations"), | ('SCALE', "Scale", "Use the manipulator for scale transformations"), | ||||
| ), | ), | ||||
| ) | ) | ||||
| def execute(self, context): | def execute(self, context): | ||||
| # show manipulator if user selects an option | # show manipulator if user selects an option | ||||
| context.space_data.show_manipulator = True | context.space_data.show_gizmo = True | ||||
| context.space_data.transform_manipulators = {self.type} | context.space_data.transform_manipulators = {self.type} | ||||
| return {'FINISHED'} | return {'FINISHED'} | ||||
| class VIEW3D_PIE_manipulator_of(Menu): | class VIEW3D_PIE_manipulator_of(Menu): | ||||
| bl_label = "Manipulator" | bl_label = "Manipulator" | ||||
| bl_idname = "view3d.manipulator_of" | bl_idname = "view3d.manipulator_of" | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| pie = layout.menu_pie() | pie = layout.menu_pie() | ||||
| pie.operator("view3d.manipulator_set", icon='MAN_TRANS', text="Translate").type = 'TRANSLATE' | pie.operator("wm.tool_set_by_name", icon='MAN_TRANS', text="Translate").name = "Move" | ||||
| pie.operator("view3d.manipulator_set", icon='MAN_ROT', text="Rotate").type = 'ROTATE' | pie.operator("wm.tool_set_by_name", icon='MAN_ROT', text="Rotate").name = "Rotate" | ||||
| pie.operator("view3d.manipulator_set", icon='MAN_SCALE', text="Scale").type = 'SCALE' | pie.operator("wm.tool_set_by_name", icon='MAN_SCALE', text="Scale").name = "Scale" | ||||
| pie.prop(context.space_data, "show_manipulator") | pie.prop(context.space_data, "show_gizmo") | ||||
| classes = ( | classes = ( | ||||
| VIEW3D_manipulator_set_of, | VIEW3D_manipulator_set_of, | ||||
| VIEW3D_PIE_manipulator_of, | VIEW3D_PIE_manipulator_of, | ||||
| ) | ) | ||||
| addon_keymaps = [] | addon_keymaps = [] | ||||
| Show All 29 Lines | |||||