diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c index f424f9b580c..06cd38944b5 100644 --- a/source/blender/blenkernel/intern/mesh.c +++ b/source/blender/blenkernel/intern/mesh.c @@ -574,7 +574,7 @@ BMesh *BKE_mesh_to_bmesh(Mesh *me, Object *ob) bm = BM_Make_Mesh(ob, allocsize); - BMO_CallOpf(bm, "mesh_to_bmesh mesh=%p object=%p", me, ob); + BMO_CallOpf(bm, "mesh_to_bmesh mesh=%p object=%p set_shapekey=%i", me, ob, 1); return bm; } diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c index 799241d052a..ad88d97284c 100644 --- a/source/blender/bmesh/intern/bmesh_opdefines.c +++ b/source/blender/bmesh/intern/bmesh_opdefines.c @@ -516,6 +516,7 @@ BMOpDefine def_mesh_to_bmesh = { "mesh_to_bmesh", {{BMOP_OPSLOT_PNT, "mesh"}, //pointer to a Mesh structure {BMOP_OPSLOT_PNT, "object"}, //pointer to an Object structure + {BMOP_OPSLOT_INT, "set_shapekey"}, //load active shapekey coordinates into verts {0, /*null-terminating sentinel*/}}, mesh_to_bmesh_exec, 0 diff --git a/source/blender/bmesh/operators/mesh_conv.c b/source/blender/bmesh/operators/mesh_conv.c index 0e8102e538c..65a3fc8b543 100644 --- a/source/blender/bmesh/operators/mesh_conv.c +++ b/source/blender/bmesh/operators/mesh_conv.c @@ -59,6 +59,7 @@ void mesh_to_bmesh_exec(BMesh *bm, BMOperator *op) { BLI_array_declare(fedges); float (*keyco)[3]= NULL; int *keyi; + int set_key = BMO_Get_Int(op, "set_shapekey"); int i, j, li, allocsize[4] = {512, 512, 2048, 512}; if (!me || !me->totvert) return; /*sanity check*/ @@ -119,7 +120,7 @@ void mesh_to_bmesh_exec(BMesh *bm, BMOperator *op) { CustomData_bmesh_init_pool(&bm->pdata, allocsize[3]); for (i=0; itotvert; i++, mvert++) { - v = BM_Make_Vert(bm, keyco ? keyco[i] : mvert->co, NULL); + v = BM_Make_Vert(bm, keyco&&set_key ? keyco[i] : mvert->co, NULL); normal_short_to_float_v3(v->no, mvert->no); vt[i] = v; diff --git a/source/blender/editors/mesh/bmeshutils.c b/source/blender/editors/mesh/bmeshutils.c index 8018640ab56..853903f9a44 100644 --- a/source/blender/editors/mesh/bmeshutils.c +++ b/source/blender/editors/mesh/bmeshutils.c @@ -602,7 +602,7 @@ static void undoMesh_to_editbtMesh(void *umv, void *emv, void *obdata) BMEdit_Free(em); bm = BM_Make_Mesh(ob, allocsize); - BMO_CallOpf(bm, "mesh_to_bmesh mesh=%p object=%p", me, ob); + BMO_CallOpf(bm, "mesh_to_bmesh mesh=%p object=%p set_shapekey=%i", me, ob, 0); em2 = BMEdit_Create(bm); *em = *em2;