forked from blender/blender
MaterialX: Implement export of Input nodes #20
@ -33,20 +33,18 @@ NodeItem NodeParser::compute_full()
|
|||||||
|
|
||||||
/* Checking if node was already computed */
|
/* Checking if node was already computed */
|
||||||
res.node = graph_->getNode(node_name());
|
res.node = graph_->getNode(node_name());
|
||||||
if (res.node) {
|
if (!res.node) {
|
||||||
return res.convert(to_type_);
|
CLOG_INFO(LOG_MATERIALX_SHADER,
|
||||||
}
|
1,
|
||||||
|
"%s [%d] => %s",
|
||||||
|
node_->name,
|
||||||
|
node_->typeinfo->type,
|
||||||
|
NodeItem::type(to_type_).c_str());
|
||||||
|
|
||||||
CLOG_INFO(LOG_MATERIALX_SHADER,
|
res = compute();
|
||||||
1,
|
if (res.node) {
|
||||||
"%s [%d] => %s",
|
res.node->setName(node_name());
|
||||||
node_->name,
|
}
|
||||||
node_->typeinfo->type,
|
|
||||||
NodeItem::type(to_type_).c_str());
|
|
||||||
|
|
||||||
res = compute();
|
|
||||||
if (res.node) {
|
|
||||||
res.node->setName(node_name());
|
|
||||||
}
|
}
|
||||||
if (NodeItem::is_arithmetic(to_type_)) {
|
if (NodeItem::is_arithmetic(to_type_)) {
|
||||||
res = res.convert(to_type_);
|
res = res.convert(to_type_);
|
||||||
|
@ -29,8 +29,9 @@ static int gpu_shader_rgb(GPUMaterial *mat,
|
|||||||
NODE_SHADER_MATERIALX_BEGIN
|
NODE_SHADER_MATERIALX_BEGIN
|
||||||
#ifdef WITH_MATERIALX
|
#ifdef WITH_MATERIALX
|
||||||
{
|
{
|
||||||
|
NodeItem color = get_output_default("Color", NodeItem::Type::Color4);
|
||||||
NodeItem res = create_node("constant", NodeItem::Type::Color4);
|
NodeItem res = create_node("constant", NodeItem::Type::Color4);
|
||||||
res.set_input("value", get_output_default("Color", NodeItem::Type::Color4));
|
res.set_input("value", color);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -41,8 +41,9 @@ static void sh_node_value_build_multi_function(NodeMultiFunctionBuilder &builder
|
|||||||
NODE_SHADER_MATERIALX_BEGIN
|
NODE_SHADER_MATERIALX_BEGIN
|
||||||
#ifdef WITH_MATERIALX
|
#ifdef WITH_MATERIALX
|
||||||
{
|
{
|
||||||
|
NodeItem value = get_output_default("Value", NodeItem::Type::Float);
|
||||||
NodeItem res = create_node("constant", NodeItem::Type::Float);
|
NodeItem res = create_node("constant", NodeItem::Type::Float);
|
||||||
res.set_input("value", get_output_default("Value", NodeItem::Type::Float));
|
res.set_input("value", value);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user