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:
authorCampbell Barton <ideasman42@gmail.com>2009-12-29 18:40:26 +0300
committerCampbell Barton <ideasman42@gmail.com>2009-12-29 18:40:26 +0300
commit5cd837a562d773cdff155ab05084af590341758d (patch)
tree20609a23f562cbf8ccf91b41af3f80240551b977 /source/blender/python/generic/bpy_internal_import.c
parentd5cef9a30d1febb22b760eb7d5cdac0fd628bb06 (diff)
* speedup for animating bones, in one scene with sintel and a dragon animated its over 4x faster.
* utility function BLI_findstring to avoid listbase lookup loops everywhere. eg: ListBase *lb= objects= &CTX_data_main(C)->object; Object *ob= BLI_findstring(lb, name, offsetof(ID, name) + 2); * made some more math functions use const's, (fix warnings I made in previous commits)
Diffstat (limited to 'source/blender/python/generic/bpy_internal_import.c')
-rw-r--r--source/blender/python/generic/bpy_internal_import.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/source/blender/python/generic/bpy_internal_import.c b/source/blender/python/generic/bpy_internal_import.c
index 002467687c4..e890dc11f05 100644
--- a/source/blender/python/generic/bpy_internal_import.c
+++ b/source/blender/python/generic/bpy_internal_import.c
@@ -33,6 +33,8 @@
#include "MEM_guardedalloc.h"
#include "BKE_text.h" /* txt_to_buf */
#include "BKE_main.h"
+#include "BLI_listbase.h"
+#include <stddef.h>
static Main *bpy_import_main= NULL;
@@ -100,10 +102,7 @@ PyObject *bpy_text_import_name( char *name, int *found )
memcpy( txtname, name, namelen );
memcpy( &txtname[namelen], ".py", 4 );
- for(text = maggie->text.first; text; text = text->id.next) {
- if( !strcmp( txtname, text->id.name+2 ) )
- break;
- }
+ text= BLI_findstring(&maggie->text, txtname, offsetof(ID, name) + 2);
if( !text )
return NULL;
@@ -142,12 +141,7 @@ PyObject *bpy_text_reimport( PyObject *module, int *found )
return NULL;
/* look up the text object */
- text = ( Text * ) & ( maggie->text.first );
- while( text ) {
- if( !strcmp( txtname, text->id.name+2 ) )
- break;
- text = text->id.next;
- }
+ text= BLI_findstring(&maggie->text, txtname, offsetof(ID, name) + 2);
/* uh-oh.... didn't find it */
if( !text )