diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index b995b5ab731..c6a9627aa3c 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -2864,6 +2864,21 @@ int RNA_property_collection_lookup_string(PointerRNA *ptr, PropertyRNA *prop, co } } +/* zero return is an assignment error */ +int RNA_property_collection_assign_int(PointerRNA *ptr, PropertyRNA *prop, const int key, PointerRNA *assign_ptr) +{ + CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)rna_ensure_property(prop); + + BLI_assert(RNA_property_type(prop) == PROP_COLLECTION); + + if(cprop->assignint) { + /* we have a callback defined, use it */ + return cprop->assignint(ptr, key, assign_ptr); + } + + return 0; +} + int RNA_property_collection_type_get(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *r_ptr) { BLI_assert(RNA_property_type(prop) == PROP_COLLECTION); |