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')
-rw-r--r--source/blender/compositor/nodes/COM_OutputFileNode.cpp8
-rw-r--r--source/blender/compositor/operations/COM_OutputFileOperation.cpp16
2 files changed, 17 insertions, 7 deletions
diff --git a/source/blender/compositor/nodes/COM_OutputFileNode.cpp b/source/blender/compositor/nodes/COM_OutputFileNode.cpp
index 3b1871b307b..94e5efe77e0 100644
--- a/source/blender/compositor/nodes/COM_OutputFileNode.cpp
+++ b/source/blender/compositor/nodes/COM_OutputFileNode.cpp
@@ -59,12 +59,12 @@ void OutputFileNode::convertToOperations(ExecutionSystem *graph, CompositorConte
bool hasConnections = false;
for (int i = 0; i < num_inputs; ++i) {
InputSocket *input = getInputSocket(i);
+ NodeImageMultiFileSocket *sockdata = (NodeImageMultiFileSocket *)input->getbNodeSocket()->storage;
+
+ outputOperation->add_layer(sockdata->layer, input->getDataType());
+
if (input->isConnected()) {
hasConnections = true;
- NodeImageMultiFileSocket *sockdata = (NodeImageMultiFileSocket *)input->getbNodeSocket()->storage;
-
- outputOperation->add_layer(sockdata->layer, input->getDataType());
-
input->relinkConnections(outputOperation->getInputSocket(i));
}
}
diff --git a/source/blender/compositor/operations/COM_OutputFileOperation.cpp b/source/blender/compositor/operations/COM_OutputFileOperation.cpp
index d0eadc5c4d1..a5be993f241 100644
--- a/source/blender/compositor/operations/COM_OutputFileOperation.cpp
+++ b/source/blender/compositor/operations/COM_OutputFileOperation.cpp
@@ -184,15 +184,21 @@ void OutputOpenExrMultiLayerOperation::add_layer(const char *name, DataType data
void OutputOpenExrMultiLayerOperation::initExecution()
{
for (unsigned int i = 0; i < this->m_layers.size(); ++i) {
- this->m_layers[i].imageInput = getInputSocketReader(i);
- this->m_layers[i].outputBuffer = init_buffer(this->getWidth(), this->getHeight(), this->m_layers[i].datatype);
+ SocketReader *reader = getInputSocketReader(i);
+ this->m_layers[i].imageInput = reader;
+ if (reader)
+ this->m_layers[i].outputBuffer = init_buffer(this->getWidth(), this->getHeight(), this->m_layers[i].datatype);
+ else
+ this->m_layers[i].outputBuffer = NULL;
}
}
void OutputOpenExrMultiLayerOperation::executeRegion(rcti *rect, unsigned int tileNumber)
{
for (unsigned int i = 0; i < this->m_layers.size(); ++i) {
- write_buffer_rect(rect, this->m_tree, this->m_layers[i].imageInput, this->m_layers[i].outputBuffer, this->getWidth(), this->m_layers[i].datatype);
+ OutputOpenExrLayer &layer = this->m_layers[i];
+ if (layer.imageInput)
+ write_buffer_rect(rect, this->m_tree, layer.imageInput, layer.outputBuffer, this->getWidth(), layer.datatype);
}
}
@@ -210,6 +216,10 @@ void OutputOpenExrMultiLayerOperation::deinitExecution()
BLI_make_existing_file(filename);
for (unsigned int i = 0; i < this->m_layers.size(); ++i) {
+ OutputOpenExrLayer &layer = this->m_layers[i];
+ if (!layer.imageInput)
+ continue; /* skip unconnected sockets */
+
char channelname[EXR_TOT_MAXNAME];
BLI_strncpy(channelname, this->m_layers[i].name, sizeof(channelname) - 2);
char *channelname_ext = channelname + strlen(channelname);