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-06-20 03:05:21 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-06-20 03:05:21 +0400
commitaa0aac706e4381624482978110a54b5959414d14 (patch)
tree6ddf414bdcc52d7da10e2d7e621113aec48520dc /source/blender/makesrna/intern/rna_rna.c
parent7349d775b0c80a112cc90888db80f481a36c4b92 (diff)
2.5
* Optimized RNA property lookups and path resolving, still can be much better, but now the 1000 IPO example on bf-taskforce25 runs at reasonable speed. * Also an optimization in the depsgraph when dealing with many objects, this was actually also a bottleneck here.
Diffstat (limited to 'source/blender/makesrna/intern/rna_rna.c')
-rw-r--r--source/blender/makesrna/intern/rna_rna.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c
index bd3a8ae5580..6fa275cec91 100644
--- a/source/blender/makesrna/intern/rna_rna.c
+++ b/source/blender/makesrna/intern/rna_rna.c
@@ -34,6 +34,8 @@
#ifdef RNA_RUNTIME
+#include "BLI_ghash.h"
+
/* Struct */
static void rna_Struct_identifier_get(PointerRNA *ptr, char *value)
@@ -277,6 +279,51 @@ PointerRNA rna_builtin_properties_get(CollectionPropertyIterator *iter)
return rna_Struct_properties_get(iter);
}
+PointerRNA rna_builtin_properties_lookup_string(PointerRNA *ptr, const char *key)
+{
+ StructRNA *srna;
+ PropertyRNA *prop;
+ IDProperty *group, *idp;
+ PointerRNA propptr;
+
+ memset(&propptr, 0, sizeof(propptr));
+ srna= ptr->type;
+
+ do {
+ if(srna->cont.prophash) {
+ prop= BLI_ghash_lookup(srna->cont.prophash, (void*)key);
+
+ if(prop) {
+ propptr.type= &RNA_Property;
+ propptr.data= prop;
+ return propptr;
+ }
+ }
+
+ for(prop=srna->cont.properties.first; prop; prop=prop->next) {
+ if(!(prop->flag & PROP_BUILTIN) && strcmp(prop->identifier, key)==0) {
+ propptr.type= &RNA_Property;
+ propptr.data= prop;
+ return propptr;
+ }
+ }
+ } while((srna=srna->base));
+
+ group= RNA_struct_idproperties(ptr, 0);
+
+ if(group) {
+ for(idp=group->data.group.first; idp; idp=idp->next) {
+ if(strcmp(idp->name, key) == 0) {
+ propptr.type= &RNA_Property;
+ propptr.data= idp;
+ return propptr;
+ }
+ }
+ }
+
+ return propptr;
+}
+
PointerRNA rna_builtin_type_get(PointerRNA *ptr)
{
return rna_pointer_inherit_refine(ptr, &RNA_Struct, ptr->type);