Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Poirier <theeth@yahoo.com>2009-12-11 02:22:43 +0300
committerMartin Poirier <theeth@yahoo.com>2009-12-11 02:22:43 +0300
commitab7e9da34299d029eab38e3e4e758ebead0b659e (patch)
tree053c3b43853549717e4e2de034bd165196be0461
parent97abf6ad96932ae5d1a3e6b6d89e271f11e9cd8a (diff)
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.
-rw-r--r--source/blender/windowmanager/intern/wm_operators.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 818dcd98afd..6d028a63c1d 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -615,6 +615,9 @@ int WM_menu_invoke(bContext *C, wmOperator *op, wmEvent *event)
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);