Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-02-22 16:11:56 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-02-22 16:11:56 +0400
commitdadc2a26e33fc2046438d4532468783ed8485a6b (patch)
tree0ca4a3b3ca84d2a2ac0542c03ea8e76fcb57f156
parent0ca14d9558db09ff8dea6d80c86f7646ba529001 (diff)
Fix #30290: Shape Keys not working as expected
New method of vertex shapekey propagation didn't restored coordinates in me->mvert array which lead to unwanted deformation of basis mesh and lead to issues like described in the report.
-rw-r--r--source/blender/bmesh/operators/bmo_mesh_conv.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/bmesh/operators/bmo_mesh_conv.c b/source/blender/bmesh/operators/bmo_mesh_conv.c
index 7b929042ea9..ce46ae7493d 100644
--- a/source/blender/bmesh/operators/bmo_mesh_conv.c
+++ b/source/blender/bmesh/operators/bmo_mesh_conv.c
@@ -759,6 +759,7 @@ void bmesh_to_mesh_exec(BMesh *bm, BMOperator *op)
currkey->data = fp = MEM_mallocN(sizeof(float) * 3 * bm->totvert, "shape key data");
currkey->totelem = bm->totvert;
+ mvert = me->mvert;
BM_ITER(eve, &iter, bm, BM_VERTS_OF_MESH, NULL) {
co = (currkey == actkey) ?
eve->co :
@@ -771,6 +772,15 @@ void bmesh_to_mesh_exec(BMesh *bm, BMOperator *op)
add_v3_v3(fp, *ofs_pt++);
}
+ if (currkey == actkey && oldverts) {
+ keyi = CustomData_bmesh_get(&bm->vdata, eve->head.data, CD_SHAPE_KEYINDEX);
+
+ if (*keyi >= 0 && *keyi < currkey->totelem) // valid old vertex
+ copy_v3_v3(mvert->co, oldverts[*keyi].co);
+
+ mvert++;
+ }
+
fp += 3;
}
break;