[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [25298] trunk/blender/source/blender/ windowmanager/intern/wm_operators.c: wm_menu_invoke calls exec automatically if property is already set.

Martin Poirier theeth at yahoo.com
Fri Dec 11 00:22:43 CET 2009


Revision: 25298
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=25298
Author:   theeth
Date:     2009-12-11 00:22:43 +0100 (Fri, 11 Dec 2009)

Log Message:
-----------
wm_menu_invoke calls exec automatically if property is already set.

This way you can set the param in the keymap and it won't always show the menu for nothing.

Modified Paths:
--------------
    trunk/blender/source/blender/windowmanager/intern/wm_operators.c

Modified: trunk/blender/source/blender/windowmanager/intern/wm_operators.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_operators.c	2009-12-10 22:23:09 UTC (rev 25297)
+++ trunk/blender/source/blender/windowmanager/intern/wm_operators.c	2009-12-10 23:22:43 UTC (rev 25298)
@@ -615,6 +615,9 @@
 	else if (RNA_property_type(prop) != PROP_ENUM) {
 		printf("WM_menu_invoke: %s \"type\" is not an enum property\n", op->type->idname);
 	}
+	else if (RNA_property_is_set(op->ptr, RNA_property_identifier(prop))) {
+		return op->type->exec(C, op);
+	}
 	else {
 		pup= uiPupMenuBegin(C, op->type->name, 0);
 		layout= uiPupMenuLayout(pup);





More information about the Bf-blender-cvs mailing list