[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [43416] trunk/blender/source/blender/ editors/object/object_ops.c: fix for defaults not being set for object mode hide and delete keymap.

Campbell Barton ideasman42 at gmail.com
Mon Jan 16 10:12:43 CET 2012


Revision: 43416
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=43416
Author:   campbellbarton
Date:     2012-01-16 09:12:34 +0000 (Mon, 16 Jan 2012)
Log Message:
-----------
fix for defaults not being set for object mode hide and delete keymap.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/object/object_ops.c

Modified: trunk/blender/source/blender/editors/object/object_ops.c
===================================================================
--- trunk/blender/source/blender/editors/object/object_ops.c	2012-01-16 09:01:11 UTC (rev 43415)
+++ trunk/blender/source/blender/editors/object/object_ops.c	2012-01-16 09:12:34 UTC (rev 43416)
@@ -268,20 +268,20 @@
 	
 	/* 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", 1);
 
 	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", 1);
 
 	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", 1);
 	
 	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", 1);
 	
 	WM_keymap_add_item(keymap, "OBJECT_OT_origin_set", CKEY, KM_PRESS, KM_ALT|KM_SHIFT|KM_CTRL, 0);
 
@@ -296,28 +296,30 @@
 	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", 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", 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, 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);
 	WM_keymap_verify_item(keymap, "OBJECT_OT_parent_clear", PKEY, KM_PRESS, KM_ALT, 0);
@@ -333,20 +335,34 @@
 	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", 1);
+#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);
 
@@ -392,7 +408,7 @@
 	
 	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);



More information about the Bf-blender-cvs mailing list