Fix T58932: Impossible to influence the particle system
authorSergey Sharybin <sergey.vfx@gmail.com>
Mon, 10 Dec 2018 16:37:30 +0000 (17:37 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Mon, 10 Dec 2018 16:37:30 +0000 (17:37 +0100)
source/blender/depsgraph/intern/builder/deg_builder_relations.cc
source/blender/depsgraph/intern/eval/deg_eval_flush.cc

index 1d5ff8cd3e58223f3b94a3ecf5cff51cfbdc78d5..81b9b32c69671eaf97ebcade65213a1659e1f151 100644 (file)
@@ -1847,6 +1847,12 @@ void DepsgraphRelationBuilder::build_particle_settings(ParticleSettings *part)
                             "Particle Texture",
                             DEPSREL_FLAG_FLUSH_USER_EDIT_ONLY);
        }
+       if (check_id_has_anim_component(&part->id)) {
+               ComponentKey animation_key(&part->id, DEG_NODE_TYPE_ANIMATION);
+               add_relation(animation_key,
+                            particle_settings_eval_key,
+                            "Particle Settings Animation");
+       }
 }
 
 void DepsgraphRelationBuilder::build_particle_system_visualization_object(
index fef3282cfcc1d132283c7ee0ddc72a1fd43ad89d..5373c142ba696c2cbf4172cc2732d0451799bf5a 100644 (file)
@@ -164,17 +164,16 @@ BLI_INLINE void flush_handle_component_node(IDDepsNode *id_node,
                return;
        }
        comp_node->custom_flags = COMPONENT_STATE_DONE;
-       /* Tag all required operations in component for update.  */
-       foreach (OperationDepsNode *op, comp_node->operations) {
-               /* We don't want to flush tags in "upstream" direction for
-                * certain types of operations.
-                *
-                * TODO(sergey): Need a more generic solution for this.
-                */
-               if (op->opcode == DEG_OPCODE_PARTICLE_SETTINGS_EVAL) {
-                       continue;
+       /* Tag all required operations in component for update, unless this is a
+        * special component where we don't want all operations to be tagged.
+        *
+        * TODO(sergey): Make this a more generic solution. */
+       if (comp_node->type != DEG_NODE_TYPE_PARTICLE_SETTINGS &&
+           comp_node->type != DEG_NODE_TYPE_PARTICLE_SYSTEM)
+       {
+               foreach (OperationDepsNode *op, comp_node->operations) {
+                       op->flag |= DEPSOP_FLAG_NEEDS_UPDATE;
                }
-               op->flag |= DEPSOP_FLAG_NEEDS_UPDATE;
        }
        /* when some target changes bone, we might need to re-run the
         * whole IK solver, otherwise result might be unpredictable.