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:
authorBrecht Van Lommel <brecht@blender.org>2022-03-11 19:50:57 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-03-21 18:38:13 +0300
commit6e4d2fa9140864a13356b07ffca082817822987f (patch)
treecb8894c3b6898e82410f3edffe2fb9d85a3a2399 /source/blender/blenkernel/intern/node.cc
parent4abb8a14a2133f876c7718a8e09284baa62b1cf5 (diff)
Cleanup: add image_format.cc for functions related to ImageFormatData
Also fixes missing code to read/write/free/copy color management settings in various places. This can't be set through the UI currently, but still should be handled consistently.
Diffstat (limited to 'source/blender/blenkernel/intern/node.cc')
-rw-r--r--source/blender/blenkernel/intern/node.cc21
1 files changed, 20 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc
index e08bfac7ce9..e3fe5d77d63 100644
--- a/source/blender/blenkernel/intern/node.cc
+++ b/source/blender/blenkernel/intern/node.cc
@@ -55,6 +55,7 @@
#include "BKE_icons.h"
#include "BKE_idprop.h"
#include "BKE_idtype.h"
+#include "BKE_image_format.h"
#include "BKE_lib_id.h"
#include "BKE_lib_query.h"
#include "BKE_main.h"
@@ -595,8 +596,13 @@ void ntreeBlendWrite(BlendWriter *writer, bNodeTree *ntree)
if (node->type == CMP_NODE_OUTPUT_FILE) {
/* Inputs have their own storage data. */
+ NodeImageMultiFile *nimf = (NodeImageMultiFile *)node->storage;
+ BKE_image_format_blend_write(writer, &nimf->format);
+
LISTBASE_FOREACH (bNodeSocket *, sock, &node->inputs) {
- BLO_write_struct(writer, NodeImageMultiFileSocket, sock->storage);
+ NodeImageMultiFileSocket *sockdata = (NodeImageMultiFileSocket *)sock->storage;
+ BLO_write_struct(writer, NodeImageMultiFileSocket, sockdata);
+ BKE_image_format_blend_write(writer, &sockdata->format);
}
}
if (ELEM(node->type, CMP_NODE_IMAGE, CMP_NODE_R_LAYERS)) {
@@ -749,6 +755,11 @@ void ntreeBlendReadData(BlendDataReader *reader, bNodeTree *ntree)
iuser->scene = nullptr;
break;
}
+ case CMP_NODE_OUTPUT_FILE: {
+ NodeImageMultiFile *nimf = (NodeImageMultiFile *)node->storage;
+ BKE_image_format_blend_read_data(reader, &nimf->format);
+ break;
+ }
case FN_NODE_INPUT_STRING: {
NodeInputString *storage = (NodeInputString *)node->storage;
BLO_read_data_address(reader, &storage->string);
@@ -771,6 +782,14 @@ void ntreeBlendReadData(BlendDataReader *reader, bNodeTree *ntree)
LISTBASE_FOREACH (bNodeSocket *, sock, &node->outputs) {
direct_link_node_socket(reader, sock);
}
+
+ /* Socket storage. */
+ if (node->type == CMP_NODE_OUTPUT_FILE) {
+ LISTBASE_FOREACH (bNodeSocket *, sock, &node->inputs) {
+ NodeImageMultiFileSocket *sockdata = (NodeImageMultiFileSocket *)sock->storage;
+ BKE_image_format_blend_read_data(reader, &sockdata->format);
+ }
+ }
}
/* interface socket lists */