Merge branch 'master' into blender2.8
[blender.git] / source / blender / depsgraph / intern / builder / deg_builder_nodes.cc
index a4c3c11d9224e37230e670575a7d02c49d14481a..d7ef1c19c612409df88b629934d0974a85b6ac90 100644 (file)
@@ -86,6 +86,7 @@ extern "C" {
 #include "BKE_mesh.h"
 #include "BKE_mball.h"
 #include "BKE_modifier.h"
+#include "BKE_movieclip.h"
 #include "BKE_node.h"
 #include "BKE_object.h"
 #include "BKE_particle.h"
@@ -841,17 +842,17 @@ void DepsgraphNodeBuilder::build_cloth(Scene *scene, Object *object)
                                         _1,
                                         scene_cow,
                                         object_cow),
-                          DEG_OPCODE_PLACEHOLDER,
-                          "Cloth Modifier");
+                          DEG_OPCODE_GEOMETRY_CLOTH_MODIFIER);
 }
 
 /* Shapekeys */
 void DepsgraphNodeBuilder::build_shapekeys(Key *key)
 {
        build_animdata(&key->id);
-
-       add_operation_node(&key->id, DEG_NODE_TYPE_GEOMETRY, NULL,
-                          DEG_OPCODE_PLACEHOLDER, "Shapekey Eval");
+       add_operation_node(&key->id,
+                          DEG_NODE_TYPE_GEOMETRY,
+                          NULL,
+                          DEG_OPCODE_GEOMETRY_SHAPEKEY);
 }
 
 /* ObData Geometry Evaluation */
@@ -1211,8 +1212,6 @@ void DepsgraphNodeBuilder::build_image(Image *image) {
                return;
        }
        image_id->tag |= LIB_TAG_DOIT;
-       /* Image ID node itself. */
-       add_id_node(image_id);
        /* Placeholder so we can add relations and tag ID node for update. */
        add_operation_node(image_id,
                           DEG_NODE_TYPE_PARAMETERS,
@@ -1237,12 +1236,12 @@ void DepsgraphNodeBuilder::build_gpencil(bGPdata *gpd)
 {
        ID *gpd_id = &gpd->id;
 
-       /* gpencil itself */
-       // XXX: what about multiple users of same datablock? This should only get added once
-       add_id_node(gpd_id);
+       /* TODO(sergey): what about multiple users of same datablock? This should
+        * only get added once.
+        */
 
-       /* The main reason Grease Pencil is included here is because the animation (and drivers)
-        * need to be hosted somewhere...
+       /* The main reason Grease Pencil is included here is because the animation
+        * (and drivers) need to be hosted somewhere.
         */
        build_animdata(gpd_id);
 }
@@ -1250,20 +1249,18 @@ void DepsgraphNodeBuilder::build_gpencil(bGPdata *gpd)
 void DepsgraphNodeBuilder::build_cachefile(CacheFile *cache_file)
 {
        ID *cache_file_id = &cache_file->id;
-
+       /* Animation, */
+       build_animdata(cache_file_id);
+       /* Cache evaluation itself. */
        add_component_node(cache_file_id, DEG_NODE_TYPE_CACHE);
        add_operation_node(cache_file_id, DEG_NODE_TYPE_CACHE, NULL,
                           DEG_OPCODE_PLACEHOLDER, "Cache File Update");
-
-       add_id_node(cache_file_id);
-       build_animdata(cache_file_id);
 }
 
 void DepsgraphNodeBuilder::build_mask(Mask *mask)
 {
        ID *mask_id = &mask->id;
-       add_id_node(mask_id);
-       /* F-Curve based animation/ */
+       /* F-Curve based animation. */
        build_animdata(mask_id);
        /* Animation based on mask's shapes. */
        add_operation_node(mask_id,
@@ -1280,8 +1277,13 @@ void DepsgraphNodeBuilder::build_mask(Mask *mask)
 void DepsgraphNodeBuilder::build_movieclip(MovieClip *clip)
 {
        ID *clip_id = &clip->id;
-       add_id_node(clip_id);
+       /* Animation. */
        build_animdata(clip_id);
+       /* Movie clip evaluation. */
+       add_operation_node(clip_id,
+                          DEG_NODE_TYPE_PARAMETERS,
+                          function_bind(BKE_movieclip_eval_update, _1, clip),
+                          DEG_OPCODE_MOVIECLIP_EVAL);
 }
 
 void DepsgraphNodeBuilder::build_lightprobe(Object *object)