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:
authorBastien Montagne <montagne29@wanadoo.fr>2018-06-21 19:24:32 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-06-21 19:26:12 +0300
commit31d916210c4e70e8c2dcb54fe0d4d2ba6940842f (patch)
treed4a13dc3755ad06cf1be309fcddb83cd41cab06f /source/blender/editors/mesh
parent6046d9f71549ee72d26cba0af77a13ff9c53e23e (diff)
Cleanup: remove DM from 'join as shape' operator.
Also deduplicated the 'mesh as shapekey' code, we had kind of two funcs doing the same thing here...
Diffstat (limited to 'source/blender/editors/mesh')
-rw-r--r--source/blender/editors/mesh/meshtools.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/editors/mesh/meshtools.c b/source/blender/editors/mesh/meshtools.c
index 6c8de1a481e..4549c0bccbf 100644
--- a/source/blender/editors/mesh/meshtools.c
+++ b/source/blender/editors/mesh/meshtools.c
@@ -612,7 +612,7 @@ int join_mesh_shapes_exec(bContext *C, wmOperator *op)
Depsgraph *depsgraph = CTX_data_depsgraph(C);
Mesh *me = (Mesh *)ob->data;
Mesh *selme = NULL;
- DerivedMesh *dm = NULL;
+ Mesh *me_deformed = NULL;
Key *key = me->key;
KeyBlock *kb;
bool ok = false, nonequal_verts = false;
@@ -646,7 +646,7 @@ int join_mesh_shapes_exec(bContext *C, wmOperator *op)
/* first key added, so it was the basis. initialize it with the existing mesh */
kb = BKE_keyblock_add(key, NULL);
- BKE_keyblock_convert_from_mesh(me, kb);
+ BKE_keyblock_convert_from_mesh(me, key, kb);
}
/* now ready to add new keys from selected meshes */
@@ -658,15 +658,15 @@ int join_mesh_shapes_exec(bContext *C, wmOperator *op)
selme = (Mesh *)base->object->data;
if (selme->totvert == me->totvert) {
- dm = mesh_get_derived_deform(depsgraph, scene, base->object, CD_MASK_BAREMESH);
+ me_deformed = mesh_get_eval_deform(depsgraph, scene, base->object, CD_MASK_BAREMESH);
- if (!dm) continue;
+ if (!me_deformed) {
+ continue;
+ }
kb = BKE_keyblock_add(key, base->object->id.name + 2);
- DM_to_meshkey(dm, me, kb);
-
- dm->release(dm);
+ BKE_mesh_runtime_eval_to_meshkey(me_deformed, me, kb);
}
}
}