diff options
author | Lukas Tönne <lukas.toenne@gmail.com> | 2014-04-25 14:00:35 +0400 |
---|---|---|
committer | Lukas Tönne <lukas.toenne@gmail.com> | 2014-04-25 14:05:23 +0400 |
commit | 005dabbd9ad51b75aef260168c81d5a826d4eb4f (patch) | |
tree | cf65862b2f2f685cc587c80b7311bd87f87d6962 /source/blender/compositor/operations/COM_OutputFileOperation.cpp | |
parent | 1eb13519768f5735c9931fec0da07d92155796f1 (diff) |
Fix T39799: Backdrop (compositor) ignores alpha.
This issue is because of a somewhat "special" behavior in old code, which got lost during rB09874df:
There was a variant of the `relinkConnections` function which would leave the socket completely unconnected. This is not a valid state really (given that each unconnected input must otherwise connected to a constant `Set` type node), but was used as a way to distinguish connected alpha/depth sockets in composite and viewer output nodes.
https://developer.blender.org/diffusion/B/browse/master/source/blender/compositor/intern/COM_InputSocket.cpp;28a829893c702918afc5ac1945a06eaefa611594$69
After the large cleanup patch ({D309}) every socket is now automatically connected to a constant, such that `getInputSocketReader` will never return a NULL pointer. This breaks the previous test method, which needs to be replaced by more explicit flags. Luckily this was done only for very few output nodes (Composite, Viewer, Output-File). These now use the regular SetValueOperation default in case "use alpha" is disabled, but set this to an explicit 1.0 value instead of mapping to the node socket.
Diffstat (limited to 'source/blender/compositor/operations/COM_OutputFileOperation.cpp')
-rw-r--r-- | source/blender/compositor/operations/COM_OutputFileOperation.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/compositor/operations/COM_OutputFileOperation.cpp b/source/blender/compositor/operations/COM_OutputFileOperation.cpp index db2f8445db7..92e8f309ea1 100644 --- a/source/blender/compositor/operations/COM_OutputFileOperation.cpp +++ b/source/blender/compositor/operations/COM_OutputFileOperation.cpp @@ -155,10 +155,12 @@ void OutputSingleLayerOperation::deinitExecution() } -OutputOpenExrLayer::OutputOpenExrLayer(const char *name_, DataType datatype_) +OutputOpenExrLayer::OutputOpenExrLayer(const char *name_, DataType datatype_, bool use_layer_) { BLI_strncpy(this->name, name_, sizeof(this->name)); this->datatype = datatype_; + this->use_layer = use_layer_; + /* these are created in initExecution */ this->outputBuffer = 0; this->imageInput = 0; @@ -174,21 +176,20 @@ OutputOpenExrMultiLayerOperation::OutputOpenExrMultiLayerOperation( this->m_exr_codec = exr_codec; } -void OutputOpenExrMultiLayerOperation::add_layer(const char *name, DataType datatype) +void OutputOpenExrMultiLayerOperation::add_layer(const char *name, DataType datatype, bool use_layer) { this->addInputSocket(datatype); - this->m_layers.push_back(OutputOpenExrLayer(name, datatype)); + this->m_layers.push_back(OutputOpenExrLayer(name, datatype, use_layer)); } void OutputOpenExrMultiLayerOperation::initExecution() { for (unsigned int i = 0; i < this->m_layers.size(); ++i) { - SocketReader *reader = getInputSocketReader(i); - this->m_layers[i].imageInput = reader; - if (reader) + if (this->m_layers[i].use_layer) { + SocketReader *reader = getInputSocketReader(i); + this->m_layers[i].imageInput = reader; this->m_layers[i].outputBuffer = init_buffer(this->getWidth(), this->getHeight(), this->m_layers[i].datatype); - else - this->m_layers[i].outputBuffer = NULL; + } } } |