diff options
author | Jacques Lucke <jacques@blender.org> | 2022-02-10 19:32:16 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-02-10 19:32:16 +0300 |
commit | 2cd1472f86dd0c3f8792f8d28b1238f9dffb3739 (patch) | |
tree | f12eedbb69cb5b426b8ff585390f09275c7fe737 | |
parent | 9a2b206639364fcc696b44879a715eaacc60347a (diff) | |
parent | 720d653b418bb5760c5891a2c8b74b72ea9889a9 (diff) |
Merge branch 'blender-v3.1-release'
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 26dd7bc1363..ac89b6b0198 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -1453,6 +1453,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 af13baad5a2..9edd52762ea 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 { |