UI: expand set origin in specials menu
authorCampbell Barton <ideasman42@gmail.com>
Thu, 29 Nov 2018 01:24:20 +0000 (12:24 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 29 Nov 2018 01:24:20 +0000 (12:24 +1100)
Also remove menu, expand operator instead.

release/scripts/startup/bl_ui/space_view3d.py

index 6e47c4c8a83e319bdae7535f69ddb7c38a9d86fe..0ba3b2217f2c7322f25ad2071279f1b1318f42e4 100644 (file)
@@ -438,22 +438,6 @@ 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):
@@ -1613,7 +1597,7 @@ class VIEW3D_MT_object(Menu):
         layout = self.layout
 
         layout.menu("VIEW3D_MT_transform_object")
-        layout.menu("VIEW3D_MT_transform_origin")
+        layout.operator_menu_enum("object.origin_set", text="Set Origin...", property="type")
         layout.menu("VIEW3D_MT_mirror")
         layout.menu("VIEW3D_MT_object_clear")
         layout.menu("VIEW3D_MT_object_apply")
@@ -1748,7 +1732,7 @@ class VIEW3D_MT_object_specials(Menu):
             layout.separator()
 
             layout.operator_context = 'INVOKE_REGION_WIN'
-            layout.operator("object.origin_set", text="Set Origin...")
+            layout.operator_menu_enum("object.origin_set", text="Set Origin...", property="type")
 
             layout.operator_context = 'INVOKE_DEFAULT'
             layout.operator("object.join")
@@ -5403,7 +5387,6 @@ 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,