forked from blender/blender
MaterialX: add support for Vector nodes #27
@ -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)}});
|
||||||
|
@ -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;
|
||||||
|
Loading…
Reference in New Issue
Block a user