diff options
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 202bd6bc615..71ebad2127a 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -283,6 +283,18 @@ int RNA_struct_is_ID(PointerRNA *ptr) return (ptr->type->flag & STRUCT_ID) != 0; } +int RNA_struct_is_a(PointerRNA *ptr, StructRNA *srna) +{ + StructRNA *type; + + /* ptr->type is always maximally refined */ + for(type=ptr->type; type; type=type->base) + if(type == srna) + return 1; + + return 0; +} + PropertyRNA *RNA_struct_find_property(PointerRNA *ptr, const char *identifier) { CollectionPropertyIterator iter; |