- bugfix, mirror modifier didn't copy deformed vertex cos for shared

verts
This commit is contained in:
Daniel Dunbar
2005-07-26 06:39:58 +00:00
parent 951a4934b0
commit 2c20d7529a

View File

@@ -429,22 +429,23 @@ static void mirrorModifier__doMirror(MirrorModifierData *mmd, DispListMesh *ndlm
for (i=0; i<totvert; i++) {
MVert *mv = &ndlm->mvert[i];
int isShared = ABS(mv->co[axis])<=tolerance;
if (ABS(mv->co[axis])<=tolerance) {
/* Because the topology result (# of vertices) must stuff the same
* if the mesh data is overridden by vertex cos, have to calc sharedness
* based on original coordinates. Only write new cos for non-shared
* vertices. This is why we test before copy.
*/
if (vertexCos) {
VECCOPY(mv->co, vertexCos[i]);
}
if (isShared) {
mv->co[axis] = 0;
*((int*) mv->no) = i;
} else {
MVert *nmv = &ndlm->mvert[ndlm->totvert];
/* Because the topology result (# of vertices) must stuff the same
* if the mesh data is overridden by vertex cos, have to calc sharedness
* based on original coordinates. Only write new cos for non-shared
* vertices.
*/
if (vertexCos) {
VECCOPY(mv->co, vertexCos[i]);
}
memcpy(nmv, mv, sizeof(*mv));
nmv ->co[axis] = -nmv ->co[axis];