Fix T45978: Ruler ignores new edit-mesh data

This commit is contained in:
Campbell Barton 2015-09-02 02:28:16 +10:00
parent 312cb0a957
commit 45eb406748
Notes: blender-bot 2023-02-14 08:42:47 +01:00
Referenced by issue #45978, Ruler points don't snap to a selected vertex and "Selection to Cursor" doesn't work with them.
1 changed files with 9 additions and 1 deletions

View File

@ -1854,8 +1854,16 @@ static bool snapObject(Scene *scene, short snap_mode, ARegion *ar, Object *ob, f
do_bb = false;
}
else {
/* in this case we wan't the mesh from the editmesh, avoids stale data. see: T45978.
* still set the 'em' to NULL, since we only want the 'dm'. */
em = BKE_editmesh_from_object(ob);
if (em) {
editbmesh_get_derived_cage_and_final(scene, ob, em, CD_MASK_BAREMESH, &dm);
}
else {
dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH);
}
em = NULL;
dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH);
}
retval = snapDerivedMesh(snap_mode, ar, ob, dm, em, obmat, ray_start, ray_normal, ray_origin, mval, r_loc, r_no, r_dist_px, r_depth, do_bb);