From dd84ff212aa5c9d6c1a03888583e11f64a978a1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 9 Jul 2019 14:45:08 +0200 Subject: Fix crash when redoing Set Origin operator The operator was using a non-evaluated depsgraph to get the evaluated scene, which caused the crash. This fixes the crash reported in T66605, but not the problem where sometimes object origins aren't set. --- source/blender/editors/object/object_transform.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender') diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index bde8bc6080c..025128a04e3 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -465,6 +465,7 @@ static void ignore_parent_tx(Main *bmain, Depsgraph *depsgraph, Scene *scene, Ob { Object workob; Object *ob_child; + Scene *scene_eval = DEG_get_evaluated_scene(depsgraph); /* a change was made, adjust the children to compensate */ @@ -974,7 +975,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); Object *obact = CTX_data_active_object(C); Object *obedit = CTX_data_edit_object(C); - Depsgraph *depsgraph = CTX_data_depsgraph(C); + Depsgraph *depsgraph = CTX_data_evaluated_depsgraph(C); Object *tob; float cent[3], cent_neg[3], centn[3]; const float *cursor = scene->cursor.location; -- cgit v1.2.3