Merge branch 'blender-v3.1-release'

This commit is contained in:
Jacques Lucke 2022-02-10 17:32:16 +01:00
commit 2cd1472f86
4 changed files with 16 additions and 1 deletions

View File

@ -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 {
/**

View File

@ -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.

View File

@ -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");
}
}
}

View File

@ -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 {