Fix crash when moving object parented to a curve

Note, we can probably remove scene from BKE_object_where_is_calc
and force to always use it from depsgraph.
This commit is contained in:
Dalai Felinto 2018-05-29 16:17:41 +02:00
parent 5eda9732b3
commit 85d845ef98
1 changed files with 7 additions and 5 deletions

View File

@ -5676,13 +5676,15 @@ static void ObjectToTransData(TransInfo *t, TransData *td, Object *ob)
if (t->mode == TFM_DUMMY)
skip_invert = true;
Scene *scene_eval = DEG_get_evaluated_scene(t->depsgraph);
if (skip_invert == false && constinv == false) {
ob->transflag |= OB_NO_CONSTRAINTS; /* BKE_object_where_is_calc_time checks this */
BKE_object_where_is_calc(t->depsgraph, t->scene, ob);
ob->transflag &= ~OB_NO_CONSTRAINTS;
ob_eval->transflag |= OB_NO_CONSTRAINTS; /* BKE_object_where_is_calc_time checks this */
BKE_object_where_is_calc(t->depsgraph, scene_eval, ob_eval);
ob_eval->transflag &= ~OB_NO_CONSTRAINTS;
}
else {
BKE_object_where_is_calc(t->depsgraph, scene_eval, ob_eval);
}
else
BKE_object_where_is_calc(t->depsgraph, t->scene, ob);
td->ob = ob;