Blender Git Commit Log

Git Commits -> Revision 9368bda

Revision 9368bda by Alexander Gavrilov (master)
August 16, 2016, 12:46 (GMT)
Fix depsgraph to compute more accurate links for collision & force.

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; on the other
hand dependency on such field implies dependency on the smoke domain.

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.

This change may cause new dependency cycles in cases where necessary
dependencies were missing, but may also remove cycles in situations
where unnecessary links were previously created. It's also now possible
to solve some cycles by switching to explicit groups, since they are
now properly taken into account for dependencies.

Differential Revision: https://developer.blender.org/D2141

Commit Details:

Full Hash: 9368bdab016badba7c7eb4ba449acd8d0c165367
Parent Commit: a74dab8
Lines Changed: +320, -321

17 Modified Paths:

/source/blender/blenkernel/BKE_collision.h (+4, -0) (Diff)
/source/blender/blenkernel/BKE_effect.h (+1, -1) (Diff)
/source/blender/blenkernel/depsgraph_private.h (+10, -0) (Diff)
/source/blender/blenkernel/intern/collision.c (+12, -6) (Diff)
/source/blender/blenkernel/intern/depsgraph.c (+44, -57) (Diff)
/source/blender/blenkernel/intern/effect.c (+18, -13) (Diff)
/source/blender/depsgraph/DEG_depsgraph_build.h (+8, -0) (Diff)
/source/blender/depsgraph/intern/builder/deg_builder_relations.cc (+70, -12) (Diff)
/source/blender/depsgraph/intern/builder/deg_builder_relations.h (+5, -0) (Diff)
/source/blender/depsgraph/intern/depsgraph_build.cc (+53, -0) (Diff)
/source/blender/makesrna/intern/rna_cloth.c (+7, -1) (Diff)
/source/blender/makesrna/intern/rna_object_force.c (+7, -2) (Diff)
/source/blender/makesrna/intern/rna_particle.c (+7, -1) (Diff)
/source/blender/modifiers/intern/MOD_cloth.c (+8, -22) (Diff)
/source/blender/modifiers/intern/MOD_dynamicpaint.c (+17, -15) (Diff)
/source/blender/modifiers/intern/MOD_smoke.c (+18, -189) (Diff)
/source/blender/modifiers/intern/MOD_softbody.c (+31, -2) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021