diff options
author | William Reynish <billreynish> | 2018-10-05 15:13:57 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2018-10-05 15:14:49 +0300 |
commit | 1aae42aa8837fe5b82bc6ba5ead90583700908ad (patch) | |
tree | 9c7d9b3201e9d9d5e72914ccd6840fb552a613e7 /release/scripts/startup/bl_ui/space_view3d.py | |
parent | 7c443ded1e2b5b0b4cec940871cee9602004f17c (diff) |
UI: move set origin operators into own object submenu.
Diffstat (limited to 'release/scripts/startup/bl_ui/space_view3d.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index f68131ae268..b84f3693274 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -424,15 +424,6 @@ class VIEW3D_MT_transform_object(VIEW3D_MT_transform_base): layout.separator() - layout.operator_context = 'EXEC_AREA' - - layout.operator("object.origin_set", text="Geometry to Origin").type = 'GEOMETRY_ORIGIN' - layout.operator("object.origin_set", text="Origin to Geometry").type = 'ORIGIN_GEOMETRY' - layout.operator("object.origin_set", text="Origin to 3D Cursor").type = 'ORIGIN_CURSOR' - layout.operator("object.origin_set", text="Origin to Center of Mass (Surface)").type = 'ORIGIN_CENTER_OF_MASS' - layout.operator("object.origin_set", text="Origin to Center of Mass (Volume)").type = 'ORIGIN_CENTER_OF_VOLUME' - layout.separator() - layout.operator("object.randomize_transform") layout.operator("object.align") @@ -443,6 +434,22 @@ class VIEW3D_MT_transform_object(VIEW3D_MT_transform_base): """ +class VIEW3D_MT_transform_origin(Menu): + bl_label = "Origin" + + def draw(self, context): + + layout = self.layout + + layout.operator_context = 'EXEC_AREA' + + layout.operator("object.origin_set", text="Geometry to Origin").type = 'GEOMETRY_ORIGIN' + layout.operator("object.origin_set", text="Origin to Geometry").type = 'ORIGIN_GEOMETRY' + layout.operator("object.origin_set", text="Origin to 3D Cursor").type = 'ORIGIN_CURSOR' + layout.operator("object.origin_set", text="Origin to Center of Mass (Surface)").type = 'ORIGIN_CENTER_OF_MASS' + layout.operator("object.origin_set", text="Origin to Center of Mass (Volume)").type = 'ORIGIN_CENTER_OF_VOLUME' + + # Armature EditMode extensions to Transform menu class VIEW3D_MT_transform_armature(VIEW3D_MT_transform_base): def draw(self, context): @@ -1589,6 +1596,7 @@ class VIEW3D_MT_object(Menu): layout = self.layout layout.menu("VIEW3D_MT_transform_object") + layout.menu("VIEW3D_MT_transform_origin") layout.menu("VIEW3D_MT_mirror") layout.menu("VIEW3D_MT_object_clear") layout.menu("VIEW3D_MT_object_apply") @@ -5141,6 +5149,7 @@ classes = ( VIEW3D_MT_transform, VIEW3D_MT_transform_base, VIEW3D_MT_transform_object, + VIEW3D_MT_transform_origin, VIEW3D_MT_transform_armature, VIEW3D_MT_mirror, VIEW3D_MT_snap, |