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
4 changed files with 16 additions and 15 deletions
Showing only changes of commit c1f4725826 - Show all commits

View File

@ -81,7 +81,8 @@ NODE_SHADER_MATERIALX_BEGIN
NodeItem location = get_input_value("Location", NodeItem::Type::Vector3);
NodeItem scale = get_input_value("Scale", NodeItem::Type::Vector3);
NodeItem vector = get_input_link("Vector", NodeItem::Type::Vector3);
NodeItem angle = (get_input_value("Rotation", NodeItem::Type::Vector3) / val(float(M_PI))) * val(180.0f);
NodeItem angle = (get_input_value("Rotation", NodeItem::Type::Vector3) / val(float(M_PI))) *
val(180.0f);
MaterialX::Vector3 axis_vector;
NodeItem in = empty();
const int mode = node_->custom1;

View File

@ -48,7 +48,7 @@ NODE_SHADER_MATERIALX_BEGIN
return res;
}
return in1;
}
}
#endif
NODE_SHADER_MATERIALX_END

View File

@ -233,7 +233,8 @@ NODE_SHADER_MATERIALX_BEGIN
return vector;
}
angle = (angle / val(float(M_PI))) * val(180.0f);
for (int i = node_->custom2 ? 2 : 0; node_->custom2 ? i >= 0 : i <= 2; node_->custom2 ? i-- : i++) {
for (int i = node_->custom2 ? 2 : 0; node_->custom2 ? i >= 0 : i <= 2;
node_->custom2 ? i-- : i++) {
axis_vector = MaterialX::Vector3(0.0f, 0.0f, 0.0f);
int inv = invert;
if (i == 2) {

View File

@ -191,7 +191,6 @@ NODE_SHADER_MATERIALX_BEGIN
#endif
NODE_SHADER_MATERIALX_END
} // namespace blender::nodes::node_shader_vector_transform_cc
void register_node_type_sh_vect_transform()