Page MenuHome

Fix T60590: apply explode modifier crash
Needs RevisionPublic

Authored by Jacques Lucke (JacquesLucke) on Jan 17 2019, 11:39 AM.


Diff Detail

rB Blender
apply-explode (branched from master)
Build Status
Buildable 2748
Build 2748: arc lint + arc unit

Event Timeline

Brecht Van Lommel (brecht) requested changes to this revision.Jan 17 2019, 12:31 PM

The problem here is that the apply modifier operator is not passing in the evaluated object in the context, as happens with regular modifier evaluation.

If we work around this in just the explode modifier it will still cause issues elsewhere, so best to fix it at the root.

This revision now requires changes to proceed.Jan 17 2019, 12:31 PM

I see, makes sense. Not sure if I'm the best person to fix this..
Why does it work like that currently? Is there a reason or is it just a bug?

I'm trying to fix this, but I have some trouble.

One question: What exactly does DEG_get_evaluated_object do in case when the object is not fully evaluated? It feels weird to pass the "already evaluated" object into the modifier that actually does the evaluation. Where am I wrong?

Right, maybe passing the fully evaluated object is not right either.

I guess technically what should happen is to re-evaluate the object up to the point of the modifier, and then apply the result from that. Because you do need object transform and animation to be evaluated on the object, in case the modifier depends on it.

@Sergey Sharybin (sergey), do you have an opinion on the right solution for this?

You are not supposed to use DEG_get_evaluated_object from within evaluation. The evaluation is to be performed on an exact objects which were passed to the evaluation.

From the quick thoughts, think the solution is to make Apply modifier to apply them on an evaluated object and then copy result back (before applying BKE_object_eval_reset() will probably be needed to be called).