Depsgraph: Add missing checks from previous commit
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 17 Nov 2017 14:27:02 +0000 (15:27 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 17 Nov 2017 14:27:02 +0000 (15:27 +0100)
source/blender/depsgraph/intern/builder/deg_builder_relations.cc

index f03cf6798331cdeabe41bcbaab6e1fbcc5ba7ef1..40fb4c9fe69822a44f5405dc1182f60ce8b6a9e3 100644 (file)
@@ -190,7 +190,7 @@ static bool particle_system_depends_on_time(ParticleSystem *psys)
        return false;
 }
 
-static bool object_particles_depends_oin_time(Object *object)
+static bool object_particles_depends_on_time(Object *object)
 {
        LINKLIST_FOREACH (ParticleSystem *, psys, &object->particlesystem) {
                if (particle_system_depends_on_time(psys)) {
@@ -1354,10 +1354,9 @@ void DepsgraphRelationBuilder::build_particles(Object *ob)
        OperationKey eval_init_key(&ob->id,
                                   DEG_NODE_TYPE_EVAL_PARTICLES,
                                   DEG_OPCODE_PARTICLE_SYSTEM_EVAL_INIT);
-       /* TODO(sergey): Are all particle systems depends on time?
-        * Hair without dynamics i.e.
-        */
-       add_relation(time_src_key, eval_init_key, "TimeSrc -> PSys");
+       if (object_particles_depends_on_time(ob)) {
+               add_relation(time_src_key, eval_init_key, "TimeSrc -> PSys");
+       }
 
        /* particle systems */
        LINKLIST_FOREACH (ParticleSystem *, psys, &ob->particlesystem) {
@@ -1587,7 +1586,7 @@ void DepsgraphRelationBuilder::build_obdata_geom(Object *ob)
                         *
                         * Ideally we need to get rid of this relation.
                         */
-                       if (object_particles_depends_oin_time(ob)) {
+                       if (object_particles_depends_on_time(ob)) {
                                TimeSourceKey time_key;
                                OperationKey obdata_ubereval_key(&ob->id,
                                                                 DEG_NODE_TYPE_GEOMETRY,