diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-01-16 01:40:33 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-01-16 01:40:33 +0300 |
commit | 5272991e8b91c527fbe3923d75ae2c5148dd7177 (patch) | |
tree | 84c871abe7d084a775ff7ffab5033c08d085ed32 /source/blender/python/intern/bpy_operator_wrap.c | |
parent | 2b3a6b38b764717878de39a97feeee186e3694ad (diff) |
generic operator menu was searching for "type" and using the first enum property if it wasnt found.
this is too arbitrary and could break if roperty order is changed.
store the property in the operator type that is to be used for menu and enum search func's.
python function for searching operator enums on invoke. (just need dynamic python enums now)
wm.invoke_search_popup(self)
Diffstat (limited to 'source/blender/python/intern/bpy_operator_wrap.c')
-rw-r--r-- | source/blender/python/intern/bpy_operator_wrap.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_operator_wrap.c b/source/blender/python/intern/bpy_operator_wrap.c index 0b855a9cacb..ebe063b7c6f 100644 --- a/source/blender/python/intern/bpy_operator_wrap.c +++ b/source/blender/python/intern/bpy_operator_wrap.c @@ -65,6 +65,16 @@ void operator_wrapper(wmOperatorType *ot, void *userdata) ot->srna= srna; /* restore */ operator_properties_init(ot); + + { /* XXX - not nice, set the first enum as searchable, should have a way for python to set */ + PointerRNA ptr; + PropertyRNA *prop; + + RNA_pointer_create(NULL, ot->srna, NULL, &ptr); + prop = RNA_struct_find_property(&ptr, "type"); + if(prop) + ot->prop= prop; + } } void macro_wrapper(wmOperatorType *ot, void *userdata) |