forked from blender/blender
MaterialX: add convert nodes #15
@ -8,15 +8,11 @@ namespace blender::nodes::materialx {
|
||||
|
||||
NodeItem BlackbodyNodeParser::compute()
|
||||
{
|
||||
/* This node doesn't have an implementation in MaterialX 1.38.6.
|
||||
* It's added in MaterialX 1.38.8. Uncomment this code after switching to 1.38.8.
|
||||
*
|
||||
* NodeItem temperature = get_input_value("Temperature", NodeItem::Type::Float);
|
||||
NodeItem temperature = get_input_value("Temperature", NodeItem::Type::Float);
|
||||
|
||||
* NodeItem res = create_node("blackbody", NodeItem::Type::Color3);
|
||||
* res.set_input("temperature", temperature);
|
||||
* return res; */
|
||||
return empty();
|
||||
NodeItem res = create_node("blackbody", NodeItem::Type::Color3);
|
||||
res.set_input("temperature", temperature);
|
||||
return res;
|
||||
}
|
||||
|
||||
} // namespace blender::nodes::materialx
|
||||
|
@ -21,7 +21,7 @@ NodeItem::Type NodeItem::type(const std::string &type_str)
|
||||
return Type::Filename;
|
||||
}
|
||||
if (type_str == "boolean") {
|
||||
return Type::Bool;
|
||||
return Type::Boolean;
|
||||
}
|
||||
if (type_str == "integer") {
|
||||
return Type::Integer;
|
||||
@ -67,7 +67,7 @@ std::string NodeItem::type(Type type)
|
||||
return "string";
|
||||
case Type::Filename:
|
||||
return "filename";
|
||||
case Type::Bool:
|
||||
case Type::Boolean:
|
||||
return "boolean";
|
||||
case Type::Integer:
|
||||
return "integer";
|
||||
@ -638,7 +638,7 @@ void NodeItem::set_input(const std::string &in_name, const NodeItem &item)
|
||||
case Type::String:
|
||||
set_input(in_name, item.value->asA<std::string>(), item_type);
|
||||
break;
|
||||
case Type::Bool:
|
||||
case Type::Boolean:
|
||||
set_input(in_name, item.value->asA<bool>(), item_type);
|
||||
break;
|
||||
case Type::Integer:
|
||||
|
@ -17,7 +17,7 @@ class NodeItem {
|
||||
/* Value types */
|
||||
String,
|
||||
Filename,
|
||||
Bool,
|
||||
Boolean,
|
||||
Integer,
|
||||
/* Block of arithmetic types. Ordered by type cast */
|
||||
Float,
|
||||
|
@ -8,9 +8,9 @@ namespace blender::nodes::materialx {
|
||||
|
||||
NodeItem RGBToBWNodeParser::compute()
|
||||
{
|
||||
NodeItem color = get_input_value("Color", NodeItem::Type::Color3);
|
||||
NodeItem color = get_input_value("Color", NodeItem::Type::Color4);
|
||||
|
||||
NodeItem res = create_node("luminance", NodeItem::Type::Color3);
|
||||
NodeItem res = create_node("luminance", NodeItem::Type::Color4);
|
||||
res.set_input("in", color);
|
||||
return res;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user