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:
authorLukas Tönne <lukas.toenne@gmail.com>2014-04-25 14:00:35 +0400
committerLukas Tönne <lukas.toenne@gmail.com>2014-04-25 14:05:23 +0400
commit005dabbd9ad51b75aef260168c81d5a826d4eb4f (patch)
treecf65862b2f2f685cc587c80b7311bd87f87d6962 /source/blender/compositor/intern
parent1eb13519768f5735c9931fec0da07d92155796f1 (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/intern')
-rw-r--r--source/blender/compositor/intern/COM_NodeConverter.cpp27
-rw-r--r--source/blender/compositor/intern/COM_NodeConverter.h7
-rw-r--r--source/blender/compositor/intern/COM_NodeOperationBuilder.cpp6
3 files changed, 39 insertions, 1 deletions
diff --git a/source/blender/compositor/intern/COM_NodeConverter.cpp b/source/blender/compositor/intern/COM_NodeConverter.cpp
index 833fcedbc53..5965eade389 100644
--- a/source/blender/compositor/intern/COM_NodeConverter.cpp
+++ b/source/blender/compositor/intern/COM_NodeConverter.cpp
@@ -103,6 +103,33 @@ NodeOperationInput *NodeConverter::addOutputProxy(NodeOutput *output)
return proxy->getInputSocket(0);
}
+void NodeConverter::addInputValue(NodeOperationInput *input, float value)
+{
+ SetValueOperation *operation = new SetValueOperation();
+ operation->setValue(value);
+
+ m_builder->addOperation(operation);
+ m_builder->addLink(operation->getOutputSocket(), input);
+}
+
+void NodeConverter::addInputColor(NodeOperationInput *input, const float value[4])
+{
+ SetColorOperation *operation = new SetColorOperation();
+ operation->setChannels(value);
+
+ m_builder->addOperation(operation);
+ m_builder->addLink(operation->getOutputSocket(), input);
+}
+
+void NodeConverter::addInputVector(NodeOperationInput *input, const float value[3])
+{
+ SetVectorOperation *operation = new SetVectorOperation();
+ operation->setVector(value);
+
+ m_builder->addOperation(operation);
+ m_builder->addLink(operation->getOutputSocket(), input);
+}
+
void NodeConverter::addOutputValue(NodeOutput *output, float value)
{
SetValueOperation *operation = new SetValueOperation();
diff --git a/source/blender/compositor/intern/COM_NodeConverter.h b/source/blender/compositor/intern/COM_NodeConverter.h
index a67dafde5e1..cad8408a2bf 100644
--- a/source/blender/compositor/intern/COM_NodeConverter.h
+++ b/source/blender/compositor/intern/COM_NodeConverter.h
@@ -75,6 +75,13 @@ public:
*/
NodeOperationInput *addOutputProxy(NodeOutput *output);
+ /** Define a constant input value. */
+ void addInputValue(NodeOperationInput *input, float value);
+ /** Define a constant input color. */
+ void addInputColor(NodeOperationInput *input, const float value[4]);
+ /** Define a constant input vector. */
+ void addInputVector(NodeOperationInput *input, const float value[3]);
+
/** Define a constant output value. */
void addOutputValue(NodeOutput *output, float value);
/** Define a constant output color. */
diff --git a/source/blender/compositor/intern/COM_NodeOperationBuilder.cpp b/source/blender/compositor/intern/COM_NodeOperationBuilder.cpp
index fdea3206d8e..a90bac847c0 100644
--- a/source/blender/compositor/intern/COM_NodeOperationBuilder.cpp
+++ b/source/blender/compositor/intern/COM_NodeOperationBuilder.cpp
@@ -85,7 +85,11 @@ void NodeOperationBuilder::convertToOperations(ExecutionSystem *system)
const OpInputs &op_to_list = find_operation_inputs(inverse_input_map, to);
if (!op_from || op_to_list.empty()) {
/* XXX allow this? error/debug message? */
- BLI_assert(false);
+ //BLI_assert(false);
+ /* XXX note: this can happen with certain nodes (e.g. OutputFile)
+ * which only generate operations in certain circumstances (rendering)
+ * just let this pass silently for now ...
+ */
continue;
}