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:
authorJacques Lucke <jacques@blender.org>2020-02-25 20:35:28 +0300
committerJacques Lucke <jacques@blender.org>2020-02-25 20:35:28 +0300
commit271a5772ebcb01e80a44d69e1988f0be9d09f2bf (patch)
treed4be3cc4769e3ec25cffe1789366cdd552a3014e
parent07fa59f11d8857cd9507aabc9855b679c8c542f0 (diff)
write node storage to file and read back
Have to find a better way to do this. An issue is that `node->typeinfo` when the node is just read.
-rw-r--r--source/blender/blenloader/intern/readfile.c5
-rw-r--r--source/blender/blenloader/intern/writefile.c7
2 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 7267b8adb00..dc575c1f805 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -3516,6 +3516,11 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree)
}
if (node->storage) {
+ if (STREQ(node->idname, "FloatAddNode")) {
+ FloatAddNodeStorage *storage = (FloatAddNodeStorage *)node->storage;
+ link_list(fd, &storage->inputs_info);
+ }
+
/* could be handlerized at some point */
switch (node->type) {
case SH_NODE_CURVE_VEC:
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index edc7eba933f..e891227e68f 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -1073,6 +1073,13 @@ static void write_nodetree_nolib(WriteData *wd, bNodeTree *ntree)
}
writestruct_id(wd, DATA, node->typeinfo->storagename, 1, node->storage);
}
+ else if (STREQ(node->idname, "FloatAddNode")) {
+ FloatAddNodeStorage *storage = (FloatAddNodeStorage *)node->storage;
+ LISTBASE_FOREACH (VariadicNodeSocketIdentifier *, value, &storage->inputs_info) {
+ writestruct_id(wd, DATA, "VariadicNodeSocketIdentifier", 1, value);
+ }
+ writestruct_id(wd, DATA, "FloatAddNodeStorage", 1, node->storage);
+ }
else {
writestruct_id(wd, DATA, node->typeinfo->storagename, 1, node->storage);
}