svn merge ^/trunk/blender -r43392:43420
[blender.git] / source / blender / editors / object / object_ops.c
index 68d11837d0d8d7dc62667befe97b0082741bd9c3..eba4dd1878a82f8ec7da4294dca9f83c7995b71a 100644 (file)
@@ -269,20 +269,20 @@ void ED_keymap_object(wmKeyConfig *keyconf)
        
        /* Note: this keymap works disregarding mode */
        kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, 0, 0);
-               RNA_enum_set(kmi->ptr, "mode", OB_MODE_EDIT);
-               RNA_boolean_set(kmi->ptr, "toggle", 1);
+       RNA_enum_set(kmi->ptr, "mode", OB_MODE_EDIT);
+       RNA_boolean_set(kmi->ptr, "toggle", TRUE);
 
        kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, KM_CTRL, 0);
-               RNA_enum_set(kmi->ptr, "mode", OB_MODE_POSE);
-               RNA_boolean_set(kmi->ptr, "toggle", 1);
+       RNA_enum_set(kmi->ptr, "mode", OB_MODE_POSE);
+       RNA_boolean_set(kmi->ptr, "toggle", TRUE);
 
        kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", VKEY, KM_PRESS, 0, 0);
-               RNA_enum_set(kmi->ptr, "mode", OB_MODE_VERTEX_PAINT);
-               RNA_boolean_set(kmi->ptr, "toggle", 1);
+       RNA_enum_set(kmi->ptr, "mode", OB_MODE_VERTEX_PAINT);
+       RNA_boolean_set(kmi->ptr, "toggle", TRUE);
        
        kmi = WM_keymap_add_item(keymap, "OBJECT_OT_mode_set", TABKEY, KM_PRESS, KM_CTRL, 0);
-               RNA_enum_set(kmi->ptr, "mode", OB_MODE_WEIGHT_PAINT);
-               RNA_boolean_set(kmi->ptr, "toggle", 1);
+       RNA_enum_set(kmi->ptr, "mode", OB_MODE_WEIGHT_PAINT);
+       RNA_boolean_set(kmi->ptr, "toggle", TRUE);
        
        WM_keymap_add_item(keymap, "OBJECT_OT_origin_set", CKEY, KM_PRESS, KM_ALT|KM_SHIFT|KM_CTRL, 0);
 
@@ -297,27 +297,29 @@ void ED_keymap_object(wmKeyConfig *keyconf)
        WM_keymap_add_item(keymap, "VIEW3D_OT_game_start", PKEY, KM_PRESS, 0, 0);
 
        kmi = WM_keymap_add_item(keymap, "OBJECT_OT_select_all", AKEY, KM_PRESS, 0, 0);
-               RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE);
+       RNA_enum_set(kmi->ptr, "action", SEL_TOGGLE);
        kmi = WM_keymap_add_item(keymap, "OBJECT_OT_select_all", IKEY, KM_PRESS, KM_CTRL, 0);
-               RNA_enum_set(kmi->ptr, "action", SEL_INVERT);
+       RNA_enum_set(kmi->ptr, "action", SEL_INVERT);
 
        WM_keymap_add_item(keymap, "OBJECT_OT_select_linked", LKEY, KM_PRESS, KM_SHIFT, 0);
        WM_keymap_add_item(keymap, "OBJECT_OT_select_grouped", GKEY, KM_PRESS, KM_SHIFT, 0);
        WM_keymap_add_item(keymap, "OBJECT_OT_select_mirror", MKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
        
-       kmi= WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, 0, 0);
-               RNA_enum_set_identifier(kmi->ptr, "direction", "PARENT");
-               RNA_boolean_set(kmi->ptr, "extend", FALSE);
-       kmi= WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
-               RNA_enum_set_identifier(kmi->ptr, "direction", "PARENT");
-               RNA_boolean_set(kmi->ptr, "extend", TRUE);
-
-       kmi= WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, 0, 0);
-               RNA_enum_set_identifier(kmi->ptr, "direction", "CHILD");
-               RNA_boolean_set(kmi->ptr, "extend", FALSE);
-       kmi= WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
-               RNA_enum_set_identifier(kmi->ptr, "direction", "CHILD");
-               RNA_boolean_set(kmi->ptr, "extend", TRUE);
+       kmi = WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, 0, 0);
+       RNA_enum_set_identifier(kmi->ptr, "direction", "PARENT");
+       RNA_boolean_set(kmi->ptr, "extend", FALSE);
+
+       kmi = WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", LEFTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_enum_set_identifier(kmi->ptr, "direction", "PARENT");
+       RNA_boolean_set(kmi->ptr, "extend", TRUE);
+
+       kmi = WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, 0, 0);
+       RNA_enum_set_identifier(kmi->ptr, "direction", "CHILD");
+       RNA_boolean_set(kmi->ptr, "extend", FALSE);
+
+       kmi = WM_keymap_add_item(keymap, "OBJECT_OT_select_hierarchy", RIGHTBRACKETKEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_enum_set_identifier(kmi->ptr, "direction", "CHILD");
+       RNA_boolean_set(kmi->ptr, "extend", TRUE);
 
        WM_keymap_verify_item(keymap, "OBJECT_OT_parent_set", PKEY, KM_PRESS, KM_CTRL, 0);
        WM_keymap_verify_item(keymap, "OBJECT_OT_parent_no_inverse_set", PKEY, KM_PRESS, KM_CTRL|KM_SHIFT, 0);
@@ -334,20 +336,34 @@ void ED_keymap_object(wmKeyConfig *keyconf)
        WM_keymap_verify_item(keymap, "OBJECT_OT_origin_clear", OKEY, KM_PRESS, KM_ALT, 0);
        
        WM_keymap_add_item(keymap, "OBJECT_OT_hide_view_clear", HKEY, KM_PRESS, KM_ALT, 0);
-       WM_keymap_add_item(keymap, "OBJECT_OT_hide_view_set", HKEY, KM_PRESS, 0, 0);
-       RNA_boolean_set(WM_keymap_add_item(keymap, "OBJECT_OT_hide_view_set", HKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "unselected", 1);
+       kmi = WM_keymap_add_item(keymap, "OBJECT_OT_hide_view_set", HKEY, KM_PRESS, 0, 0);
+       RNA_boolean_set(kmi->ptr, "unselected", FALSE);
+
+       kmi = WM_keymap_add_item(keymap, "OBJECT_OT_hide_view_set", HKEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_boolean_set(kmi->ptr, "unselected", TRUE);
 
        /* same as above but for rendering */
        WM_keymap_add_item(keymap, "OBJECT_OT_hide_render_clear", HKEY, KM_PRESS, KM_ALT|KM_CTRL, 0);
        WM_keymap_add_item(keymap, "OBJECT_OT_hide_render_set", HKEY, KM_PRESS, KM_CTRL, 0);
-//     RNA_boolean_set(WM_keymap_add_item(keymap, "OBJECT_OT_hide_render_set", HKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0)->ptr, "unselected", 1); // conflicts, removing
+
+       /* conflicts, removing */
+#if 0
+       kmi = WM_keymap_add_item(keymap, "OBJECT_OT_hide_render_set", HKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0)
+       RNA_boolean_set(kmi->ptr, "unselected", TRUE);
+#endif
 
        WM_keymap_add_item(keymap, "OBJECT_OT_move_to_layer", MKEY, KM_PRESS, 0, 0);
        
-       WM_keymap_add_item(keymap, "OBJECT_OT_delete", XKEY, KM_PRESS, 0, 0);
-       RNA_boolean_set(WM_keymap_add_item(keymap, "OBJECT_OT_delete", XKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "use_global", TRUE);
+       kmi = WM_keymap_add_item(keymap, "OBJECT_OT_delete", XKEY, KM_PRESS, 0, 0);
+       RNA_boolean_set(kmi->ptr, "use_global", FALSE);
+
+       kmi = WM_keymap_add_item(keymap, "OBJECT_OT_delete", XKEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_boolean_set(kmi->ptr, "use_global", TRUE);
+
        WM_keymap_add_item(keymap, "OBJECT_OT_delete", DELKEY, KM_PRESS, 0, 0);
-       RNA_boolean_set(WM_keymap_add_item(keymap, "OBJECT_OT_delete", DELKEY, KM_PRESS, KM_SHIFT, 0)->ptr, "use_global", TRUE);
+       RNA_boolean_set(kmi->ptr, "use_global", FALSE);
+       kmi = WM_keymap_add_item(keymap, "OBJECT_OT_delete", DELKEY, KM_PRESS, KM_SHIFT, 0);
+       RNA_boolean_set(kmi->ptr, "use_global", TRUE);
 
        WM_keymap_add_menu(keymap, "INFO_MT_add", AKEY, KM_PRESS, KM_SHIFT, 0);
 
@@ -393,7 +409,7 @@ void ED_keymap_object(wmKeyConfig *keyconf)
        
        WM_keymap_add_item(keymap, "OBJECT_OT_vertex_parent_set", PKEY, KM_PRESS, KM_CTRL, 0);
        
-               /* menus */
+       /* menus */
        WM_keymap_add_menu(keymap, "VIEW3D_MT_hook", HKEY, KM_PRESS, KM_CTRL, 0);
 
        ED_object_generic_keymap(keyconf, keymap, 2);