diff options
Diffstat (limited to 'source/blender/depsgraph')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_nodes.cc | 25 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 20 |
2 files changed, 37 insertions, 8 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index 15e3ea3e10f..1613e9f6e53 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -122,12 +122,24 @@ 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); + ID *id = *idpoin; + if (id == NULL) { + return; + } + switch (GS(id->name)) { + case ID_OB: + data->builder->build_object(NULL, (Object *)id); + break; + case ID_TE: + data->builder->build_texture((Tex *)id); + break; + default: + /* pass */ + break; } } @@ -342,7 +354,7 @@ void DepsgraphNodeBuilder::build_object(Base *base, Object *object) 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) { @@ -1053,6 +1065,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) { diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 40db9d1b5f1..6f3686f2a10 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -122,12 +122,24 @@ struct BuilderWalkUserData { 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(*obpoin); + ID *id = *idpoin; + if (id == NULL) { + return; + } + switch (GS(id->name)) { + case ID_OB: + data->builder->build_object((Object *)id); + break; + case ID_TE: + data->builder->build_texture((Tex *)id); + break; + default: + /* pass */ + break; } } @@ -459,7 +471,7 @@ void DepsgraphRelationBuilder::build_object(Object *object) 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) { |