diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-03-15 01:30:57 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-03-15 01:30:57 +0300 |
commit | 64078786cc2df63d9d8f1d10c48a5bda24639bcb (patch) | |
tree | 7b04b805df03708497bc21f973f1ddff7e58eb0d /source/blender/makesrna/intern/rna_internal.h | |
parent | 14c2fc3c12f2f5b43a8689f2a54c249a4325118c (diff) |
Fix #20486: blender hangs upon import attempt of an .obj with >40k polys.
Added automatic generation of lookup_int callbacks for collections, for
quicker lookup by index instead of looping over the whole thing. Import
is still quite slow, though now it only takes a few seconds.
The next bottleneck seems to be running update (depsgraph, notifiers, ..)
on setting every property. I fixed part of that by avoiding a notifier
to be added each time, now it checks for duplicates.
Diffstat (limited to 'source/blender/makesrna/intern/rna_internal.h')
-rw-r--r-- | source/blender/makesrna/intern/rna_internal.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_internal.h b/source/blender/makesrna/intern/rna_internal.h index 06e0a96deed..68a7ca29a1f 100644 --- a/source/blender/makesrna/intern/rna_internal.h +++ b/source/blender/makesrna/intern/rna_internal.h @@ -297,6 +297,7 @@ void rna_iterator_listbase_begin(struct CollectionPropertyIterator *iter, struct void rna_iterator_listbase_next(struct CollectionPropertyIterator *iter); void *rna_iterator_listbase_get(struct CollectionPropertyIterator *iter); void rna_iterator_listbase_end(struct CollectionPropertyIterator *iter); +PointerRNA rna_listbase_lookup_int(PointerRNA *ptr, StructRNA *type, struct ListBase *lb, int index); typedef struct ArrayIterator { char *ptr; @@ -311,6 +312,7 @@ void rna_iterator_array_next(struct CollectionPropertyIterator *iter); void *rna_iterator_array_get(struct CollectionPropertyIterator *iter); void *rna_iterator_array_dereference_get(struct CollectionPropertyIterator *iter); void rna_iterator_array_end(struct CollectionPropertyIterator *iter); +PointerRNA rna_array_lookup_int(PointerRNA *ptr, StructRNA *type, void *data, int itemsize, int length, int index); /* Duplicated code since we can't link in blenlib */ |