object apply menu and keybinding (Ctrl+A)
authorCampbell Barton <ideasman42@gmail.com>
Thu, 15 Oct 2009 20:15:21 +0000 (20:15 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 15 Oct 2009 20:15:21 +0000 (20:15 +0000)
release/scripts/ui/space_view3d.py
source/blender/editors/object/object_ops.c

index dfc491522f597bd458bdae2517b41bf86c05ef8c..cac2b88f39ebf78cd4e6187fe30d740dc944e781 100644 (file)
@@ -395,6 +395,7 @@ class VIEW3D_MT_object(bpy.types.Menu):
                layout = self.layout
 
                layout.itemM("VIEW3D_MT_object_clear")
+               layout.itemM("VIEW3D_MT_object_apply")
                layout.itemM("VIEW3D_MT_snap")
                
                layout.itemS()
@@ -437,6 +438,18 @@ class VIEW3D_MT_object_clear(bpy.types.Menu):
                layout.itemO("object.scale_clear", text="Scale")
                layout.itemO("object.origin_clear", text="Origin")
                
+class VIEW3D_MT_object_apply(bpy.types.Menu):
+       __label__ = "Apply"
+
+       def draw(self, context):
+               layout = self.layout
+               
+               layout.itemO("object.location_apply", text="Location")
+               layout.itemO("object.rotation_apply", text="Rotation")
+               layout.itemO("object.scale_apply", text="Scale")
+               layout.itemS()
+               layout.itemO("object.visual_transform_apply", text="Visual Transform")
+
 class VIEW3D_MT_object_parent(bpy.types.Menu):
        __label__ = "Parent"
 
@@ -1396,6 +1409,7 @@ bpy.types.register(VIEW3D_MT_select_edit_armature)
 bpy.types.register(VIEW3D_MT_select_face) # XXX todo
 
 bpy.types.register(VIEW3D_MT_object) # Object Menu
+bpy.types.register(VIEW3D_MT_object_apply)
 bpy.types.register(VIEW3D_MT_object_clear)
 bpy.types.register(VIEW3D_MT_object_parent)
 bpy.types.register(VIEW3D_MT_object_track)
index 775f9937095f662a550498c77265aad1d0ec5a84..5c53e041f6e711c9ce511e6accb4c8221c70c3fb 100644 (file)
@@ -249,6 +249,9 @@ void ED_keymap_object(wmKeyConfig *keyconf)
        kmi= WM_keymap_add_item(keymap, "WM_OT_call_menu", AKEY, KM_PRESS, KM_SHIFT, 0);
        RNA_string_set(kmi->ptr, "name", "INFO_MT_add");
 
+       kmi= WM_keymap_add_item(keymap, "WM_OT_call_menu", AKEY, KM_PRESS, KM_CTRL, 0);
+       RNA_string_set(kmi->ptr, "name", "VIEW3D_MT_object_apply");
+
        WM_keymap_add_item(keymap, "OBJECT_OT_duplicate_move", DKEY, KM_PRESS, KM_SHIFT, 0);
        RNA_boolean_set(WM_keymap_add_item(keymap, "OBJECT_OT_duplicate", DKEY, KM_PRESS, KM_ALT, 0)->ptr, "linked", 1);
        WM_keymap_add_item(keymap, "OBJECT_OT_join", JKEY, KM_PRESS, KM_CTRL, 0);