forked from blender/blender
MaterialX: Fix group nodes. #32
@ -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,9 +32,8 @@ NodeItem GroupNodeParser::compute()
|
||||
graph = group_graph.get();
|
||||
#endif
|
||||
|
||||
NodeItem out =
|
||||
GroupOutputNodeParser(
|
||||
graph, depsgraph_, material_, node_out, socket_out_, NodeItem::Type::Any, this)
|
||||
NodeItem out = GroupOutputNodeParser(
|
||||
graph, depsgraph_, material_, node_out, socket_out_, to_type_, this)
|
||||
.compute_full();
|
||||
|
||||
#ifdef USE_MATERIALX_NODEGRAPH
|
||||
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user