Merge branch 'master' into blender2.8
[blender.git] / source / blender / depsgraph / intern / builder / deg_builder_nodes.cc
index 7d606629acbdbb2c48d6b83692500dbf16e2ee18..565218d8be009dececbfede8c18c3ee01045b934 100644 (file)
@@ -124,14 +124,26 @@ struct BuilderWalkUserData {
 
 static void modifier_walk(void *user_data,
                           struct Object * /*object*/,
-                          struct Object **obpoin,
+                          struct ID **idpoin,
                           int /*cb_flag*/)
 {
        BuilderWalkUserData *data = (BuilderWalkUserData *)user_data;
-       if (*obpoin) {
-               data->builder->build_object(NULL,
-                                           *obpoin,
-                                           DEG_ID_LINKED_INDIRECTLY);
+       ID *id = *idpoin;
+       if (id == NULL) {
+               return;
+       }
+       switch (GS(id->name)) {
+               case ID_OB:
+                       data->builder->build_object(NULL,
+                                                   (Object *)id,
+                                                   DEG_ID_LINKED_INDIRECTLY);
+                       break;
+               case ID_TE:
+                       data->builder->build_texture((Tex *)id);
+                       break;
+               default:
+                       /* pass */
+                       break;
        }
 }
 
@@ -483,7 +495,7 @@ void DepsgraphNodeBuilder::build_object(Base *base,
        if (object->modifiers.first != NULL) {
                BuilderWalkUserData data;
                data.builder = this;
-               modifiers_foreachObjectLink(object, modifier_walk, &data);
+               modifiers_foreachIDLink(object, modifier_walk, &data);
        }
        /* Constraints. */
        if (object->constraints.first != NULL) {
@@ -1315,6 +1327,11 @@ void DepsgraphNodeBuilder::build_texture(Tex *texture)
                        build_image(texture->ima);
                }
        }
+       /* Placeholder so we can add relations and tag ID node for update. */
+       add_operation_node(&texture->id,
+                          DEG_NODE_TYPE_PARAMETERS,
+                          NULL,
+                          DEG_OPCODE_PLACEHOLDER);
 }
 
 void DepsgraphNodeBuilder::build_image(Image *image) {