From 180e021b6ceb8e906ecf06c1b298f68c99c5026c Mon Sep 17 00:00:00 2001 From: Vasyl-Pidhirskyi Date: Fri, 22 Sep 2023 18:59:23 +0300 Subject: [PATCH] Specified to_type. Improved GroupInputNodeParser::compute(). Improved GroupOutputNodeParser::compute(). --- .../nodes/shader/materialx/group_nodes.cc | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/source/blender/nodes/shader/materialx/group_nodes.cc b/source/blender/nodes/shader/materialx/group_nodes.cc index 7f13fb108aef..0a6f28ba0480 100644 --- a/source/blender/nodes/shader/materialx/group_nodes.cc +++ b/source/blender/nodes/shader/materialx/group_nodes.cc @@ -3,6 +3,7 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ #include "group_nodes.h" +#include "node_item.h" #include "node_parser.h" #include "BLI_vector.hh" @@ -31,10 +32,9 @@ NodeItem GroupNodeParser::compute() graph = group_graph.get(); #endif - NodeItem out = - GroupOutputNodeParser( - graph, depsgraph_, material_, node_out, socket_out_, NodeItem::Type::Any, this) - .compute_full(); + NodeItem out = GroupOutputNodeParser( + graph, depsgraph_, material_, node_out, socket_out_, to_type_, this) + .compute_full(); #ifdef USE_MATERIALX_NODEGRAPH /* We have to be in NodeParser's graph_, therefore copying output */ @@ -73,7 +73,10 @@ NodeItem GroupOutputNodeParser::compute() } return outputs[socket_out_->index()]; #else - return get_input_value(socket_out_->index(), NodeItem::Type::Any); + if (NodeItem::is_arithmetic(to_type_)) { + return get_input_value(socket_out_->index(), to_type_); + } + return get_input_link(socket_out_->index(), to_type_); #endif } @@ -115,6 +118,9 @@ NodeItem GroupInputNodeParser::compute() } return create_input("input" + std::to_string(socket_out_->index() + 1), value); #else + if (NodeItem::is_arithmetic(to_type_)) { + return group_parser_->get_input_value(socket_out_->index(), to_type_); + } return group_parser_->get_input_link(socket_out_->index(), to_type_); #endif } -- 2.30.2