Fix force fields not affecting rigid bodies
authorSergej Reich <sergej.reich@googlemail.com>
Thu, 13 Dec 2018 10:54:18 +0000 (11:54 +0100)
committerSergej Reich <sergej.reich@googlemail.com>
Thu, 13 Dec 2018 11:34:35 +0000 (12:34 +0100)
This fixes part of T58991.
Still need to add proper relations so that point cache is marked as outdated
when effectors are modified.

source/blender/depsgraph/intern/builder/deg_builder_relations.cc

index 81b9b32c69671eaf97ebcade65213a1659e1f151..23328721e2cf358eaf21e774c89c752db2ff1295 100644 (file)
@@ -1597,6 +1597,14 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene)
 
        /* set up dependencies between these operations and other builtin nodes --------------- */
 
+       /* effectors */
+       ListBase *relations = deg_build_effector_relations(graph_, rbw->effector_weights->group);
+       LISTBASE_FOREACH (EffectorRelation *, relation, relations) {
+               ComponentKey eff_key(&relation->ob->id, DEG_NODE_TYPE_TRANSFORM);
+               add_relation(eff_key, init_key, "RigidBody Field");
+               // FIXME add relations so pointache is marked as outdated when effectors are modified
+       }
+
        /* time dependency */
        TimeSourceKey time_src_key;
        add_relation(time_src_key, init_key, "TimeSrc -> Rigidbody Reset/Rebuild (Optional)");