diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-12-15 03:53:46 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-12-15 03:53:46 +0400 |
commit | 27a56719a81867942a344f53aacc3e6170f5ba54 (patch) | |
tree | 2ef23dc9ac34ccbf1f4d244191e721608b3f0f08 /source/blender/editors | |
parent | 40a2c1a2921b50edd8b798e79b6bd2a6d94d7bba (diff) |
minor vertex group edits
* when freeing a deform weight, use one less memcpy call.
* vgroup_delete_object_mode(), was looping on the deform verts twice when it didn't need to.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/object/object_vgroup.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 7d63d7dc270..50fe9d26cf9 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -1697,7 +1697,7 @@ static void vgroup_delete_update_users(Object *ob, int id) static void vgroup_delete_object_mode(Object *ob, bDeformGroup *dg) { MDeformVert *dvert_array=NULL; - int i, e, dvert_tot=0; + int dvert_tot=0; const int def_nr= BLI_findindex(&ob->defbase, dg); assert(def_nr > -1); @@ -1705,20 +1705,21 @@ static void vgroup_delete_object_mode(Object *ob, bDeformGroup *dg) ED_vgroup_give_array(ob->data, &dvert_array, &dvert_tot); if(dvert_array) { + int i, j; MDeformVert *dv; for(i= 0, dv= dvert_array; i < dvert_tot; i++, dv++) { MDeformWeight *dw; dw= defvert_find_index(dv, def_nr); defvert_remove_group(dv, dw); /* dw can be NULL */ - } - for(i= 0, dv= dvert_array; i < dvert_tot; i++, dv++) { - for(e = 0; e < dv->totweight; e++) { - if(dv->dw[e].def_nr > def_nr) { - dv->dw[e].def_nr--; + /* inline, make into a function if anything else needs to do this */ + for(j = 0; j < dv->totweight; j++) { + if(dv->dw[j].def_nr > def_nr) { + dv->dw[j].def_nr--; } } + /* done */ } } |