Merge branch 'master' into blender2.8
[blender.git] / source / blender / depsgraph / intern / builder / deg_builder_relations.cc
index 890e6c050d0974f7322300c5a4fca16416f2825e..077bdd94f562f5d73815d5241663dbc67d813848 100644 (file)
@@ -104,7 +104,9 @@ extern "C" {
 
 #include "intern/nodes/deg_node.h"
 #include "intern/nodes/deg_node_component.h"
+#include "intern/nodes/deg_node_id.h"
 #include "intern/nodes/deg_node_operation.h"
+#include "intern/nodes/deg_node_time.h"
 
 #include "intern/depsgraph_intern.h"
 #include "intern/depsgraph_types.h"
@@ -429,8 +431,6 @@ void DepsgraphRelationBuilder::build_group(Object *object, Group *group)
                LINKLIST_FOREACH(Base *, base, &group->view_layer->object_bases) {
                        build_object(NULL, base->object);
                }
-
-               build_view_layer_collections(&group->id, group->view_layer);
                group_id->tag |= LIB_TAG_DOIT;
        }
 
@@ -923,7 +923,7 @@ void DepsgraphRelationBuilder::build_animdata(ID *id)
        /* Animation curves and NLA. */
        build_animdata_curves(id);
        /* Drivers. */
-       build_animdata_drievrs(id);
+       build_animdata_drivers(id);
 }
 
 void DepsgraphRelationBuilder::build_animdata_curves(ID *id)
@@ -992,7 +992,7 @@ void DepsgraphRelationBuilder::build_animdata_curves_targets(ID *id)
        }
 }
 
-void DepsgraphRelationBuilder::build_animdata_drievrs(ID *id)
+void DepsgraphRelationBuilder::build_animdata_drivers(ID *id)
 {
        AnimData *adt = BKE_animdata_from_id(id);
        if (adt == NULL) {
@@ -1173,9 +1173,9 @@ void DepsgraphRelationBuilder::build_driver_variables(ID *id, FCurve *fcu)
                                        continue;
                                }
                                OperationKey variable_key(dtar->id,
-                                                       DEG_NODE_TYPE_BONE,
-                                                       target_pchan->name,
-                                                       DEG_OPCODE_BONE_DONE);
+                                                         DEG_NODE_TYPE_BONE,
+                                                         target_pchan->name,
+                                                         DEG_OPCODE_BONE_DONE);
                                if (is_same_bone_dependency(variable_key, self_key)) {
                                        continue;
                                }
@@ -1200,10 +1200,13 @@ void DepsgraphRelationBuilder::build_driver_variables(ID *id, FCurve *fcu)
                                if (RNA_pointer_is_null(&variable_key.ptr)) {
                                        continue;
                                }
-                               if (is_same_bone_dependency(variable_key, self_key)) {
+                               if (is_same_bone_dependency(variable_key, self_key) ||
+                                   is_same_nodetree_node_dependency(variable_key, self_key) ||
+                                   is_same_shapekey_dependency(variable_key, self_key))
+                               {
                                        continue;
                                }
-                               add_relation(variable_key, driver_key, "RNA Bone -> Driver");
+                               add_relation(variable_key, driver_key, "RNA Target -> Driver");
                        }
                        else {
                                if (dtar->id == id) {
@@ -1353,9 +1356,6 @@ void DepsgraphRelationBuilder::build_particles(Object *object)
        OperationKey eval_init_key(&object->id,
                                   DEG_NODE_TYPE_EVAL_PARTICLES,
                                   DEG_OPCODE_PARTICLE_SYSTEM_EVAL_INIT);
-       if (object_particles_depends_on_time(object)) {
-               add_relation(time_src_key, eval_init_key, "TimeSrc -> PSys");
-       }
 
        /* particle systems */
        LINKLIST_FOREACH (ParticleSystem *, psys, &object->particlesystem) {
@@ -1454,6 +1454,13 @@ void DepsgraphRelationBuilder::build_particles(Object *object)
                if (part->ren_as == PART_DRAW_OB && part->dup_ob) {
                        ComponentKey dup_ob_key(&part->dup_ob->id, DEG_NODE_TYPE_TRANSFORM);
                        add_relation(dup_ob_key, psys_key, "Particle Object Visualization");
+                       if (part->dup_ob->type == OB_MBALL) {
+                               ComponentKey dup_geometry_key(&part->dup_ob->id,
+                                                             DEG_NODE_TYPE_GEOMETRY);
+                               add_relation(obdata_ubereval_key,
+                                            dup_geometry_key,
+                                            "Particle MBall Visualization");
+                       }
                }
        }
 
@@ -1918,7 +1925,8 @@ void DepsgraphRelationBuilder::build_gpencil(bGPdata *gpd)
        // TODO: parent object (when that feature is implemented)
 }
 
-void DepsgraphRelationBuilder::build_cachefile(CacheFile *cache_file) {
+void DepsgraphRelationBuilder::build_cachefile(CacheFile *cache_file)
+{
        /* Animation. */
        build_animdata(&cache_file->id);
 }