Page MenuHome

Fix T88250: Crash when instancing disabled object.
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on May 25 2021, 4:02 PM.

Details

Summary

The issue was that BKE_object_eval_uber_data was not called for the text object, because its geometry was not dependent upon and its is_directly_visible tag was false.
The crash happens in rendering code, because the evaluated data is missing.

Possible solutions:

  • Make sure is_directly_visible is true for the objects used by geometry nodes (because they might be instanced). The issue with that is that updateDepsgraph in MOD_nodes.cc is only responsible for creating relations, while is_directly_visible seems to be set in deg_builder_nodes.cc. Not sure if there is a reliable way to update is_directly_visible from updateDepsgraph and have it work correctly with recursive stuff etc.
  • Add a dependency from the geometry nodes modifier to the geometry of the text object. This way, the text objects geometry will be computed, even when is_directly_visible is false. While we can't read geometry from text objects in geometry nodes right now, we most likely will at some point. So this dependency will have to be added at some point anyway.

In general, the fix is not only necessary for text objects but for all object types that have a geometry component that geometry nodes does not support yet.
In the future, we want to have a bit more granular dependencies to data blocks referenced by geometry nodes, but that's going to be a bit more complex and cannot be done as a simple fix.

The risk of introducing severe bugs with this patch is fairly low. If I'm not mistaken, in the worst case, we add a dependency to a node that isn't there, which will result in a warning in the console (this is what was originally fixed by rB22574f741c4e4d142c7068316296d24bbfc2a12c, which "caused" this bug). I wasn't able to create a case where this warning would be printed yet.

Diff Detail

Repository
rB Blender

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.May 25 2021, 4:02 PM
Jacques Lucke (JacquesLucke) created this revision.

Make sure is_directly_visible is true for the objects used by geometry nodes (because they might be instanced)

Don't think this is the right direction to go. This should be handled by a relation from instanced to instancer objects. This way if the instancer is not visible (not needed by the renderer) the instanced object will not be evaluated.

This seems to be what your second suggestion and this patch is doing. This seems correct to me.

This revision is now accepted and ready to land.May 26 2021, 10:34 AM