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>2010-08-22 18:15:28 +0400
committerCampbell Barton <ideasman42@gmail.com>2010-08-22 18:15:28 +0400
commit0bab23633a07942586f963c19d053f26c44d799b (patch)
tree77065471bb213e0c782aa955eb77d1ca3a728d88 /source/blender/blenkernel/intern/key.c
parent96429a4792cb2b30c8e96ab6cedcd3f6c884fc38 (diff)
remove inline loops in a few places
replace with defgroup_find_name() and BLI_findstring()
Diffstat (limited to 'source/blender/blenkernel/intern/key.c')
-rw-r--r--source/blender/blenkernel/intern/key.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/key.c b/source/blender/blenkernel/intern/key.c
index f4b931ec52b..708403ab1f7 100644
--- a/source/blender/blenkernel/intern/key.c
+++ b/source/blender/blenkernel/intern/key.c
@@ -50,6 +50,7 @@
#include "BKE_animsys.h"
#include "BKE_curve.h"
#include "BKE_customdata.h"
+#include "BKE_deform.h"
#include "BKE_global.h"
#include "BKE_key.h"
#include "BKE_lattice.h"
@@ -1003,7 +1004,6 @@ static void do_key(int start, int end, int tot, char *poin, Key *key, KeyBlock *
static float *get_weights_array(Object *ob, char *vgroup)
{
- bDeformGroup *curdef;
MDeformVert *dvert= NULL;
EditMesh *em= NULL;
EditVert *eve;
@@ -1030,11 +1030,8 @@ static float *get_weights_array(Object *ob, char *vgroup)
if(dvert==NULL) return NULL;
/* find the group (weak loop-in-loop) */
- for (curdef = ob->defbase.first; curdef; curdef=curdef->next, index++)
- if (!strcmp(curdef->name, vgroup))
- break;
-
- if(curdef) {
+ index= defgroup_name_index(ob, vgroup);
+ if(index >= 0) {
float *weights;
int i, j;
@@ -1539,14 +1536,8 @@ KeyBlock *key_get_keyblock(Key *key, int index)
/* get the appropriate KeyBlock given a name to search for */
KeyBlock *key_get_named_keyblock(Key *key, const char name[])
{
- KeyBlock *kb;
-
- if (key && name) {
- for (kb= key->block.first; kb; kb= kb->next) {
- if (strcmp(name, kb->name)==0)
- return kb;
- }
- }
+ if (key && name)
+ return BLI_findstring(&key->block, name, offsetof(KeyBlock, name));
return NULL;
}