diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-04-04 13:57:36 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2018-04-04 13:57:36 +0300 |
commit | ef22b837e8e22fd1d6f566edeef9d090032e0996 (patch) | |
tree | 11c2d46d8d549097dc96f1558bc8984884fe7795 /source | |
parent | 39585e1abc13181938568bdc905cff1bee267775 (diff) | |
parent | 0c7ec5896638480c8ed0a67d80026b83e4d12526 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_nodes.cc | 29 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 20 |
2 files changed, 39 insertions, 10 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index 7d606629acb..565218d8be0 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -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) { diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 5e25f60e3ac..96a99eea624 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -123,12 +123,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(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; } } @@ -463,7 +475,7 @@ void DepsgraphRelationBuilder::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) { |