Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/blenkernel/intern/node.cc')
-rw-r--r--source/blender/blenkernel/intern/node.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc
index 288d46bf089..7d5ba4189a3 100644
--- a/source/blender/blenkernel/intern/node.cc
+++ b/source/blender/blenkernel/intern/node.cc
@@ -63,6 +63,7 @@
#include "BKE_anim_data.h"
#include "BKE_animsys.h"
+#include "BKE_bpath.h"
#include "BKE_colortools.h"
#include "BKE_cryptomatte.h"
#include "BKE_global.h"
@@ -416,6 +417,29 @@ static void node_foreach_cache(ID *id,
}
}
+static void node_foreach_path(ID *id, BPathForeachPathData *bpath_data)
+{
+ bNodeTree *ntree = reinterpret_cast<bNodeTree *>(id);
+
+ switch (ntree->type) {
+ case NTREE_SHADER: {
+ LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
+ if (node->type == SH_NODE_SCRIPT) {
+ NodeShaderScript *nss = reinterpret_cast<NodeShaderScript *>(node->storage);
+ BKE_bpath_foreach_path_fixed_process(bpath_data, nss->filepath);
+ }
+ else if (node->type == SH_NODE_TEX_IES) {
+ NodeShaderTexIES *ies = reinterpret_cast<NodeShaderTexIES *>(node->storage);
+ BKE_bpath_foreach_path_fixed_process(bpath_data, ies->filepath);
+ }
+ }
+ break;
+ }
+ default:
+ break;
+ }
+}
+
static ID *node_owner_get(Main *bmain, ID *id)
{
if ((id->flag & LIB_EMBEDDED_DATA) == 0) {
@@ -1055,6 +1079,7 @@ IDTypeInfo IDType_ID_NT = {
/* make_local */ nullptr,
/* foreach_id */ node_foreach_id,
/* foreach_cache */ node_foreach_cache,
+ /* foreach_path */ node_foreach_path,
/* owner_get */ node_owner_get,
/* blend_write */ ntree_blend_write,