Fix T66919: Force field does not affect particles
authorSergey Sharybin <sergey.vfx@gmail.com>
Wed, 17 Jul 2019 09:40:02 +0000 (11:40 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Wed, 17 Jul 2019 14:51:02 +0000 (16:51 +0200)
Reviewers: brecht

Reviewed By: brecht

Maniphest Tasks: T66919

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

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

index c59fb5f2a38f9a7099a97dbfb0f254949aa4864e..86cbb3301705c9c92e3561fc0a7eb28a4c5c09bc 100644 (file)
@@ -379,6 +379,14 @@ void DepsgraphRelationBuilder::add_particle_forcefield_relations(const Operation
 {
   ListBase *relations = build_effector_relations(graph_, eff->group);
 
+  /* Make sure physics effects like wind are properly re-evaluating the modifier stack. */
+  if (!BLI_listbase_is_empty(relations)) {
+    TimeSourceKey time_src_key;
+    ComponentKey geometry_key(&object->id, NodeType::GEOMETRY);
+    add_relation(
+        time_src_key, geometry_key, "Effector Time -> Particle", RELATION_CHECK_BEFORE_ADD);
+  }
+
   LISTBASE_FOREACH (EffectorRelation *, relation, relations) {
     if (relation->ob != object) {
       /* Relation to forcefield object, optionally including geometry. */