View3D Snap: Don't mix original/evaluated in the same function parameters.

This commit is contained in:
Germano Cavalcante 2019-06-11 18:45:46 -03:00
parent f92bb695c4
commit d93a7290e5
Notes: blender-bot 2023-02-14 08:59:10 +01:00
Referenced by issue #65761, Eevee render inconsistency between 3D View, Viewport render, and F12 Render
Referenced by issue #65758, Eevee screenspace reflections disabling AO
Referenced by issue #65738, Blender 2.8 - No way of previewing the final render in the viewport
Referenced by issue #65714, Blender Crashes when using Mac trackpad Pinching(zoom) in Node Editor
Referenced by issue #64913, LookDev with environment texture starts washed out, until viewport moves
1 changed files with 8 additions and 7 deletions

View File

@ -428,13 +428,14 @@ static int snap_selected_to_location(bContext *C,
sub_v3_v3(cursor_parent, ob->obmat[3]);
if (ob->parent) {
float parentmat[4][4];
/* The evaluated object is used here because sometimes
* `runtime.curve_cache` is required. */
Object *ob_parent_eval = DEG_get_evaluated_object(depsgraph, ob->parent);
BKE_object_get_parent_matrix(ob, ob_parent_eval, parentmat);
mul_m3_m4m4(imat, parentmat, ob->parentinv);
invert_m3(imat);
float originmat[3][3], parentmat[4][4];
/* Use the evaluated object here because sometimes
* `ob->parent->runtime.curve_cache` is required. */
Object *ob_eval = DEG_get_evaluated_object(depsgraph, ob);
BKE_object_get_parent_matrix(ob_eval, ob_eval->parent, parentmat);
mul_m3_m4m4(originmat, parentmat, ob->parentinv);
invert_m3_m3(imat, originmat);
mul_m3_v3(imat, cursor_parent);
}
if ((ob->protectflag & OB_LOCK_LOCX) == 0) {