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.
This commit is contained in:
2019-07-09 14:45:08 +02:00
parent 484794ce67
commit dd84ff212a

View File

@@ -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;