Page MenuHome

Depsgraph: Support depending on collection geometry.
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Apr 22 2021, 6:35 PM.

Details

Summary

This fixes at least T87666 and T83252.

The boolean modifier and geometry nodes can depend on the geometry of an entire collection. Before this patch, the modifiers had to manually create relations to all the objects in the collection. This worked for the most part, but was cumbersome and did not solve all issues. For example, the modifiers were not properly updated when objects were added/removed from the referenced collection.

This patch introduces the concept of "collection geometry" in the depsgraph. The geometry of a collection depends on the transforms and geometry of all the objects in it. The boolean modifier and geometry nodes can now just depend on the collection geometry instead of creating all the dependencies themselves.

Diff Detail

Repository
rB Blender

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.Apr 22 2021, 6:35 PM
Jacques Lucke (JacquesLucke) created this revision.

This is a great improvement! It seems to work well for me. I wonder, how is a dependency graph relation handled for collection instance objects? Wouldn't that be similar?

I did get a failed assert once while testing, but I can't reproduce it now, and I don't even quite remember what I did..
add_operation: Operation already exists - 8)Geometry Component : GRLots of Planes( affects_directly_visible: false) has GEOMETRY_EVAL_DONE() at 0x611000bdb408

Adding Sybren as reviewer since I believe Sergey is not doing much depsgraph review at the moment. If Sybren is not comfortable reviewing this then of course sergey can be set as blocker reviewer

  • Merge branch 'master' into depsgraph-collection-geometry
  • don't build operation node more than once

I wonder, how is a dependency graph relation handled for collection instance objects? Wouldn't that be similar?

Yes, I think that makes sense. We could give collection instance empty objects a GEOMETRY_EVAL_DONE node as well. Not sure if that should be done in the same patch though.

To me this seems to be nice and proper idea. The code seems to be fine.
The only thing I'd ask is to keep an eye on the related topics, in case there is some side-effect or issue in the implementation we are not immediately catching.

This revision is now accepted and ready to land.Apr 26 2021, 3:12 PM

Argh, clicked the wrong button, sorry Sybren.
But the patch seems good to me anyway. So have a great day!

Thanks for the review Sergey!