Current implementation more or less indiscriminately links physics
objects to colliders and forces, ignoring precise details of layer
checks and collider groups. The new depsgraph seemed to lack some
such links at all. The relevant code in modifiers suffers from a
lot of duplication.
Different physics simulations use independent implementations of
collision and similar things, which results in a lot of variance:
- Cloth collides with objects on same or visible layer with dupli.
- Softbody collides with objects on same layer without dupli.
- Non-hair particles collide on same layer with dupli.
- Smoke uses same code as cloth, but needs different modifier.
- Dynamic paint "collides" with brushes on any layer without dupli.
Force fields with absorption also imply dependency on colliders:
- For most systems, colliders are selected from same layer as field.
- For non-hair particles, it uses the same exact set as the particles.
As a special quirk, smoke ignores smoke flow force fields.
This introduces two utility functions each for old and new depsgraph
that are flexible enough to handle all these variations, and uses them
to handle particles, cloth, smoke, softbody and dynpaint.
One thing to watch out for is that depsgraph code shouldn't rely on
any properties that don't cause a graph rebuild when changed. This
was violated in the original code that was building force field links,
while taking zero field weights into account.