Fix T51977: New depsgraph removes the grass in victor scene
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 7 Jul 2017 14:38:56 +0000 (16:38 +0200)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 7 Jul 2017 14:38:56 +0000 (16:38 +0200)
For now just make new depsgraph do similar updates to the old one.

See bug report for more detailed information about what was going on.

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

index dbe8a5f1984c0fa925194d269b9159457e0a0e70..62a7d6c6ab78d7c6b92214bc59b9981f2685471c 100644 (file)
@@ -1465,6 +1465,19 @@ void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Obje
        /* type-specific node/links */
        switch (ob->type) {
                case OB_MESH:
+                       /* NOTE: This is compatibility code to support particle systems
+                        *
+                        * for viewport being properly rendered in final render mode.
+                        * This relation is similar to what dag_object_time_update_flags()
+                        * was doing for mesh objects with particle system/
+                        *
+                        * Ideally we need to get rid of this relation.
+                        */
+                       if (ob->particlesystem.first != NULL) {
+                               TimeSourceKey time_key;
+                               OperationKey obdata_ubereval_key(&ob->id, DEG_NODE_TYPE_GEOMETRY, DEG_OPCODE_GEOMETRY_UBEREVAL);
+                               add_relation(time_key, obdata_ubereval_key, "Legacy particle time");
+                       }
                        break;
 
                case OB_MBALL: