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:
authorManuel Castilla <manzanillawork@gmail.com>2021-05-27 21:43:43 +0300
committerManuel Castilla <manzanillawork@gmail.com>2021-05-27 22:23:44 +0300
commitce7f952e25c238f7bad4da837447c645398a27f3 (patch)
tree2d5a9311d7346a71d74fadb5f0774c7167d4b46e /source/blender/compositor/intern/COM_Node.cc
parent0642543a1be3349c527b302140407250b32425ea (diff)
Fix: Unavailable sockets are used during compositing execution
When translating node tree into operations, unavailable sockets (with flag SOCK_UNAVAIL) are converted into operations sockets too. This causes an assertion to fail when selecting a multi-layer image with a "Combined" layer in image node because it maps associated "Alpha" socket to output operation socket twice (as there is an "Image" socket too but with SOCK_UNAVAIL flag). ImageNode::convertToOperations assumes there is a single socket for combined pass but in this case the unavailable "Image" socket is used too for combined pass. Image node sockets are marked with SOCK_UNAVAIL flag instead of being removed to keep connections of unused sockets but during compositing execution they shouldn't be created as they are not executed. This problem has become visible after commit 93e2491, as now map add_new is used instead of just overwriting last mapped socket.
Diffstat (limited to 'source/blender/compositor/intern/COM_Node.cc')
-rw-r--r--source/blender/compositor/intern/COM_Node.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/compositor/intern/COM_Node.cc b/source/blender/compositor/intern/COM_Node.cc
index 6ac48e3646c..41f3050f908 100644
--- a/source/blender/compositor/intern/COM_Node.cc
+++ b/source/blender/compositor/intern/COM_Node.cc
@@ -47,6 +47,11 @@ Node::Node(bNode *editorNode, bool create_sockets)
if (create_sockets) {
bNodeSocket *input = (bNodeSocket *)editorNode->inputs.first;
while (input != nullptr) {
+ if (input->flag & SOCK_UNAVAIL) {
+ input = input->next;
+ continue;
+ }
+
DataType dt = DataType::Value;
if (input->type == SOCK_RGBA) {
dt = DataType::Color;
@@ -60,6 +65,11 @@ Node::Node(bNode *editorNode, bool create_sockets)
}
bNodeSocket *output = (bNodeSocket *)editorNode->outputs.first;
while (output != nullptr) {
+ if (output->flag & SOCK_UNAVAIL) {
+ output = output->next;
+ continue;
+ }
+
DataType dt = DataType::Value;
if (output->type == SOCK_RGBA) {
dt = DataType::Color;