MaterialX: add support for Vector nodes #27

Merged
Bogdan Nagirniak merged 13 commits from Vasyl-Pidhirskyi/blender:BLEN-525 into matx-export-material 2023-09-22 10:03:45 +02:00
2 changed files with 2 additions and 2 deletions
Showing only changes of commit 5e5a31e22d - Show all commits

View File

@ -625,7 +625,7 @@ NodeItem NodeItem::rotate3d(NodeItem rotation, bool invert)
int j = invert ? 2 - i : i; int j = invert ? 2 - i : i;
MaterialX::Vector3 axis_vector = MaterialX::Vector3(); MaterialX::Vector3 axis_vector = MaterialX::Vector3();
axis_vector[j] = 1.0f; axis_vector[j] = 1.0f;
res = create_node( return create_node(
"rotate3d", "rotate3d",
NodeItem::Type::Vector3, NodeItem::Type::Vector3,
{{"in", res}, {"amount", rotation.extract(j)}, {"axis", val(axis_vector)}}); {{"in", res}, {"amount", rotation.extract(j)}, {"axis", val(axis_vector)}});

View File

@ -41,7 +41,7 @@ NODE_SHADER_MATERIALX_BEGIN
NodeItem res = get_output_default("Normal", NodeItem::Type::Vector3); NodeItem res = get_output_default("Normal", NodeItem::Type::Vector3);
if (STREQ(socket_out_->name, "Dot")) { if (STREQ(socket_out_->name, "Dot")) {
res = res.dotproduct(get_input_value("Normal", NodeItem::Type::Vector3)); return res.dotproduct(get_input_value("Normal", NodeItem::Type::Vector3));
} }
return res; return res;