diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-05-11 02:05:47 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-05-11 02:05:47 +0400 |
commit | 3e1e76a2c1f711b4888cb6e82892f6c765b21fef (patch) | |
tree | 648b9023659155728c7efd6706c5d34cece44746 /source/blender/python/intern | |
parent | 8e13bb3f602eac73296e98fe149d8bd18165a244 (diff) |
Fix #35289: UV layout export to image was extremely slow for large meshes. This
was due to slow implementation of slice operation for things like mesh uv data.
Made that faster now for cases where the internal storage is an array.
Diffstat (limited to 'source/blender/python/intern')
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index f1c0530fedf..a0b2cd639bb 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -2270,7 +2270,7 @@ static PyObject *pyrna_prop_collection_subscript_str_lib_pair(BPy_PropertyRNA *s static PyObject *pyrna_prop_collection_subscript_slice(BPy_PropertyRNA *self, Py_ssize_t start, Py_ssize_t stop) { CollectionPropertyIterator rna_macro_iter; - int count = 0; + int count; PyObject *list; PyObject *item; @@ -2279,20 +2279,12 @@ static PyObject *pyrna_prop_collection_subscript_slice(BPy_PropertyRNA *self, Py list = PyList_New(0); - /* first loop up-until the start */ - for (RNA_property_collection_begin(&self->ptr, self->prop, &rna_macro_iter); - rna_macro_iter.valid; - RNA_property_collection_next(&rna_macro_iter)) - { - /* PointerRNA itemptr = rna_macro_iter.ptr; */ - if (count == start) { - break; - } - count++; - } + /* skip to start */ + RNA_property_collection_begin(&self->ptr, self->prop, &rna_macro_iter); + RNA_property_collection_skip(&rna_macro_iter, start); /* add items until stop */ - for (; rna_macro_iter.valid; + for (count = start; rna_macro_iter.valid; RNA_property_collection_next(&rna_macro_iter)) { item = pyrna_struct_CreatePyObject(&rna_macro_iter.ptr); |