diff options
Diffstat (limited to 'source/blender/editors/object/object_vgroup.c')
-rw-r--r-- | source/blender/editors/object/object_vgroup.c | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index ea118602c6c..43de351e4c1 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -51,13 +51,8 @@ #include "BKE_customdata.h" #include "BKE_deform.h" #include "BKE_depsgraph.h" -#include "BKE_DerivedMesh.h" -#include "BKE_displist.h" #include "BKE_global.h" -#include "BKE_lattice.h" #include "BKE_mesh.h" -#include "BKE_paint.h" -#include "BKE_utildefines.h" #include "BKE_tessmesh.h" #include "BKE_report.h" @@ -80,7 +75,7 @@ static Lattice *vgroup_edit_lattice(Object *ob) { if(ob->type==OB_LATTICE) { Lattice *lt= ob->data; - return (lt->editlatt)? lt->editlatt: lt; + return (lt->editlatt)? lt->editlatt->latt: lt; } return NULL; @@ -177,7 +172,7 @@ int ED_vgroup_give_parray(ID *id, MDeformVert ***dvert_arr, int *dvert_tot) int i=0; Lattice *lt= (Lattice *)id; - lt= (lt->editlatt)? lt->editlatt: lt; + lt= (lt->editlatt)? lt->editlatt->latt: lt; *dvert_tot= lt->pntsu*lt->pntsv*lt->pntsw; *dvert_arr= MEM_mallocN(sizeof(void*)*(*dvert_tot), "vgroup parray from me"); @@ -211,7 +206,7 @@ int ED_vgroup_give_array(ID *id, MDeformVert **dvert_arr, int *dvert_tot) case ID_LT: { Lattice *lt= (Lattice *)id; - lt= (lt->editlatt)? lt->editlatt: lt; + lt= (lt->editlatt)? lt->editlatt->latt: lt; *dvert_arr= lt->dvert; *dvert_tot= lt->pntsu*lt->pntsv*lt->pntsw; return TRUE; @@ -541,18 +536,8 @@ float ED_vgroup_vert_weight(Object *ob, bDeformGroup *dg, int vertnum) } void ED_vgroup_select_by_name(Object *ob, char *name) -{ - bDeformGroup *curdef; - int actdef= 1; - - for(curdef = ob->defbase.first; curdef; curdef=curdef->next, actdef++){ - if(!strcmp(curdef->name, name)) { - ob->actdef= actdef; - return; - } - } - - ob->actdef= 0; // this signals on painting to create a new one, if a bone in posemode is selected */ +{ /* note: ob->actdef==0 signals on painting to create a new one, if a bone in posemode is selected */ + ob->actdef= defgroup_name_index(ob, name) + 1; } /********************** Operator Implementations *********************/ |