diff options
Diffstat (limited to 'source')
4 files changed, 16 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_node_tree_update.h b/source/blender/blenkernel/BKE_node_tree_update.h index 834445420ef..bfb8c337cdc 100644 --- a/source/blender/blenkernel/BKE_node_tree_update.h +++ b/source/blender/blenkernel/BKE_node_tree_update.h @@ -26,6 +26,7 @@ struct bNode; struct bNodeLink; struct bNodeSocket; struct bNodeTree; +struct ImageUser; #ifdef __cplusplus extern "C" { @@ -68,6 +69,8 @@ void BKE_ntree_update_tag_missing_runtime_data(struct bNodeTree *ntree); void BKE_ntree_update_tag_interface(struct bNodeTree *ntree); /** Used when an id data block changed that might be used by nodes that need to be updated. */ void BKE_ntree_update_tag_id_changed(struct Main *bmain, struct ID *id); +/** Used when an image user is updated that is used by any part of the node tree. */ +void BKE_ntree_update_tag_image_user_changed(struct bNodeTree *ntree, struct ImageUser *iuser); typedef struct NodeTreeUpdateExtraParams { /** diff --git a/source/blender/blenkernel/intern/node_tree_update.cc b/source/blender/blenkernel/intern/node_tree_update.cc index 9f3ce68ca69..bea73ec8065 100644 --- a/source/blender/blenkernel/intern/node_tree_update.cc +++ b/source/blender/blenkernel/intern/node_tree_update.cc @@ -1642,6 +1642,12 @@ void BKE_ntree_update_tag_id_changed(Main *bmain, ID *id) FOREACH_NODETREE_END; } +void BKE_ntree_update_tag_image_user_changed(bNodeTree *ntree, ImageUser *UNUSED(iuser)) +{ + /* Would have to search for the node that uses the image user for a more detailed tag. */ + add_tree_tag(ntree, NTREE_CHANGED_ANY); +} + /** * Protect from recursive calls into the updating function. Some node update functions might * trigger this from Python or in other cases. diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index cb43ef685d4..462e61c5671 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -1486,6 +1486,10 @@ void DepsgraphRelationBuilder::build_animation_images(ID *id) OperationKey world_update_key(id, NodeType::SHADING, OperationCode::WORLD_UPDATE); add_relation(world_update_key, image_animation_key, "World Update -> Image Animation"); } + else if (GS(id->name) == ID_NT) { + OperationKey ntree_output_key(id, NodeType::NTREE_OUTPUT, OperationCode::NTREE_OUTPUT); + add_relation(ntree_output_key, image_animation_key, "NTree Output -> Image Animation"); + } } } diff --git a/source/blender/makesrna/intern/rna_image.c b/source/blender/makesrna/intern/rna_image.c index 0d86572357f..c45c27778a6 100644 --- a/source/blender/makesrna/intern/rna_image.c +++ b/source/blender/makesrna/intern/rna_image.c @@ -27,6 +27,7 @@ #include "BLI_utildefines.h" #include "BKE_image.h" +#include "BKE_node_tree_update.h" #include "DEG_depsgraph.h" #include "DEG_depsgraph_build.h" @@ -167,7 +168,8 @@ static void rna_ImageUser_update(Main *bmain, Scene *scene, PointerRNA *ptr) if (id) { if (GS(id->name) == ID_NT) { - /* Special update for nodetrees to find parent datablock. */ + /* Special update for nodetrees. */ + BKE_ntree_update_tag_image_user_changed((bNodeTree *)id, iuser); ED_node_tree_propagate_change(NULL, bmain, NULL); } else { |