Fix crazyspace transform w/ armatures

This commit is contained in:
Campbell Barton
2018-12-06 12:53:58 +11:00
parent 74db65e542
commit 8afc4cf3ea
2 changed files with 8 additions and 2 deletions

View File

@@ -119,7 +119,7 @@ float (*BKE_crazyspace_get_mapped_editverts(
/* now get the cage */
vertexcos = MEM_mallocN(sizeof(*vertexcos) * nverts, "vertexcos map");
me_eval = editbmesh_get_eval_cage(depsgraph, scene, obedit, me->edit_btmesh, CD_MASK_BAREMESH);
me_eval = editbmesh_get_eval_cage_from_orig(depsgraph, scene, obedit, me->edit_btmesh, CD_MASK_BAREMESH);
mesh_get_mapped_verts_coords(me_eval, vertexcos, nverts);

View File

@@ -2711,9 +2711,15 @@ static void createTransEditVerts(TransInfo *t)
if (modifiers_getCageIndex(t->scene, tc->obedit, NULL, 1) != -1) {
int totleft = -1;
if (modifiers_isCorrectableDeformed(t->scene, tc->obedit)) {
/* Use evaluated state because we need b-bone cache. */
Scene *scene_eval = (Scene *)DEG_get_evaluated_id(t->depsgraph, &t->scene->id);
Object *obedit_eval = (Object *)DEG_get_evaluated_id(t->depsgraph, &tc->obedit->id);
BMEditMesh *em_eval = BKE_editmesh_from_object(obedit_eval);
/* check if we can use deform matrices for modifier from the
* start up to stack, they are more accurate than quats */
totleft = BKE_crazyspace_get_first_deform_matrices_editbmesh(t->depsgraph, t->scene, tc->obedit, em, &defmats, &defcos);
totleft = BKE_crazyspace_get_first_deform_matrices_editbmesh(
t->depsgraph, scene_eval, obedit_eval, em_eval,
&defmats, &defcos);
}
/* if we still have more modifiers, also do crazyspace