diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2006-11-12 02:23:15 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2006-11-12 02:23:15 +0300 |
commit | e4a1eb4e09384aee760d45db1841666c92972743 (patch) | |
tree | b83af584c08afa2e08c21da528d4defde8813bf9 /source/blender/src/editobject.c | |
parent | 8857f4ce86cd277d45e513ef1025cd91c4c74753 (diff) |
Added custom vertex data support to editmode. Only used for vertex groups
now, others can be added later (sticky, shape keys). Beside one small fix
for knife exact vertex group interpolation, is intended to work the same
as before.
Also fixes bug #5200, related to editmode undo and vertex groups. And
corrects the editmode to faceselect mode selection conversion, that was
broken in a previous commit.
Diffstat (limited to 'source/blender/src/editobject.c')
-rw-r--r-- | source/blender/src/editobject.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/src/editobject.c b/source/blender/src/editobject.c index 57802d3eb3e..280ca5be08b 100644 --- a/source/blender/src/editobject.c +++ b/source/blender/src/editobject.c @@ -95,6 +95,7 @@ #include "BKE_anim.h" #include "BKE_armature.h" #include "BKE_constraint.h" +#include "BKE_customdata.h" #include "BKE_blender.h" #include "BKE_booleanops.h" #include "BKE_curve.h" @@ -360,19 +361,24 @@ static int return_editmesh_indexar(int *tot, int **indexar, float *cent) static int return_editmesh_vgroup(char *name, float *cent) { EditMesh *em = G.editMesh; + MDeformVert *dvert; EditVert *eve; int i, totvert=0; cent[0]= cent[1]= cent[2]= 0.0; - if (G.obedit->actdef) { + if(G.obedit->actdef) { /* find the vertices */ for(eve= em->verts.first; eve; eve= eve->next) { - for (i=0; i<eve->totweight; i++){ - if(eve->dw[i].def_nr == (G.obedit->actdef-1)) { - totvert++; - VecAddf(cent, cent, eve->co); + dvert= CustomData_em_get(&em->vdata, eve->data, LAYERTYPE_MDEFORMVERT); + + if(dvert) { + for(i=0; i<dvert->totweight; i++){ + if(dvert->dw[i].def_nr == (G.obedit->actdef-1)) { + totvert++; + VecAddf(cent, cent, eve->co); + } } } } |