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:
authorCampbell Barton <ideasman42@gmail.com>2011-01-16 13:08:20 +0300
committerCampbell Barton <ideasman42@gmail.com>2011-01-16 13:08:20 +0300
commit4dd92a988a5fe5a73ddeefbd663fe0e38b1808ab (patch)
tree372890e5d6d16c6f358a7624fc31581f4f4a076b /source/blender/python
parenta72f02c025ba86e21b250752af3ca129b9eb805c (diff)
Defining bpy.props.EnumProperty(... , options={'ENUM_FLAG'}) wasnt working right with default values.
Diffstat (limited to 'source/blender/python')
-rw-r--r--source/blender/python/intern/bpy_props.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c
index bdd1f0575bd..4fbcca3fe94 100644
--- a/source/blender/python/intern/bpy_props.c
+++ b/source/blender/python/intern/bpy_props.c
@@ -676,11 +676,12 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
if(!eitems)
return NULL;
- prop= RNA_def_enum(srna, id, eitems, defvalue, name, description);
+ if(opts & PROP_ENUM_FLAG) prop= RNA_def_enum_flag(srna, id, eitems, defvalue, name, description);
+ else prop= RNA_def_enum(srna, id, eitems, defvalue, name, description);
+
if(pyopts) {
if(opts & PROP_HIDDEN) RNA_def_property_flag(prop, PROP_HIDDEN);
if((opts & PROP_ANIMATABLE)==0) RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
- if(opts & PROP_ENUM_FLAG) RNA_def_property_flag(prop, PROP_ENUM_FLAG);
}
RNA_def_property_duplicate_pointers(srna, prop);
MEM_freeN(eitems);