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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-03-15 02:17:55 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-03-15 02:17:55 +0300
commitcc59417cae9de2c08900d76b3d9cfb6683e530b2 (patch)
tree5debe30cc15a8908ca35430bc7daf754da3450ec /source/blender/makesrna/intern/rna_access.c
parente7e655ce746039601d8ecc3896db744e81c4dea8 (diff)
RNA:
- Added an autogenerated C++ API, basically a simple layer over the C API, but with the advantage that it fits the object oriented RNA model better. Read-only still like the C API. - Had to rename "protected" property in Action Group because it is a C++ keyword, called it "locked" since that seems more consistent anyway? - It's not used anywhere, so here's some example code I used to test it, to get an idea of how it would be used: http://pasteall.org/4582/cpp - Also, ID names are now editable.
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r--source/blender/makesrna/intern/rna_access.c12
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;