diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-06-07 18:53:08 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-06-07 18:53:08 +0400 |
commit | bb06e311a18518740edec42dce26d377ab16f0d7 (patch) | |
tree | 9d163f631f461c5a53e46a44384eefed125bea76 /source/blender/python | |
parent | eecf7722b635545f0f5c51b74a15418e3cc9f47e (diff) |
added item_enumO() so python menu items can call enum types with string args.
Example sequencer menu
self.layout.column()
self.layout.item_enumO("SEQUENCER_OT_effect_strip_add", property='type', value='ADD', text="Effect Strip (Add)")
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 983e69845bd..12c19bd3471 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -2059,9 +2059,7 @@ PyObject *pyrna_basetype_register(PyObject *self, PyObject *args) item= PyObject_GetAttrString(py_class, "__rna__"); if(!item || !BPy_StructRNA_Check(item)) { - if(item) { - Py_DECREF(item); - } + Py_XDECREF(item); PyErr_SetString(PyExc_AttributeError, "expected a Type subclassed from a registerable rna type (no __rna__ property)."); return NULL; } |