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/editmesh_mods.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/editmesh_mods.c')
-rw-r--r-- | source/blender/src/editmesh_mods.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/source/blender/src/editmesh_mods.c b/source/blender/src/editmesh_mods.c index c5958be912b..52befe8a64c 100644 --- a/source/blender/src/editmesh_mods.c +++ b/source/blender/src/editmesh_mods.c @@ -1167,20 +1167,26 @@ int vertgroup_select(short mode) return selcount; } } - } else if (mode==3 && base_eve->totweight != 0) { /* vertex groups */ - short i,j; /*weight index*/ + } else if (mode==3) { /* vertex groups */ + MDeformVert *dvert, *base_dvert; + short i, j; /* weight index */ + + base_dvert= CustomData_em_get(&em->vdata, base_eve->data, + LAYERTYPE_MDEFORMVERT); + + if (!base_dvert || base_dvert->totweight == 0) + return selcount; for(eve= em->verts.first; eve; eve= eve->next) { - if ( - !(eve->f & SELECT) && - !eve->h && - eve->totweight - ) { + dvert= CustomData_em_get(&em->vdata, eve->data, + LAYERTYPE_MDEFORMVERT); + + if (dvert && !(eve->f & SELECT) && !eve->h && dvert->totweight) { /* do the extra check for selection in the following if, so were not checking verts that may be alredy selected */ - for (i=0; base_eve->totweight >i && !(eve->f & SELECT); i++) { - for (j=0; eve->totweight >j; j++) { - if (base_eve->dw[i].def_nr==eve->dw[j].def_nr) { + for (i=0; base_dvert->totweight >i && !(eve->f & SELECT); i++) { + for (j=0; dvert->totweight >j; j++) { + if (base_dvert->dw[i].def_nr==dvert->dw[j].def_nr) { eve->f |= SELECT; selcount++; deselcount--; |