Fix force fields not affecting rigid bodies
[blender.git] / 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)");