forked from blender/blender
MaterialX: add support for Vector nodes #27
@ -81,7 +81,8 @@ NODE_SHADER_MATERIALX_BEGIN
|
|||||||
NodeItem location = get_input_value("Location", NodeItem::Type::Vector3);
|
NodeItem location = get_input_value("Location", NodeItem::Type::Vector3);
|
||||||
NodeItem scale = get_input_value("Scale", NodeItem::Type::Vector3);
|
NodeItem scale = get_input_value("Scale", NodeItem::Type::Vector3);
|
||||||
NodeItem vector = get_input_link("Vector", 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;
|
MaterialX::Vector3 axis_vector;
|
||||||
NodeItem in = empty();
|
NodeItem in = empty();
|
||||||
const int mode = node_->custom1;
|
const int mode = node_->custom1;
|
||||||
|
@ -233,7 +233,8 @@ NODE_SHADER_MATERIALX_BEGIN
|
|||||||
return vector;
|
return vector;
|
||||||
}
|
}
|
||||||
angle = (angle / val(float(M_PI))) * val(180.0f);
|
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);
|
axis_vector = MaterialX::Vector3(0.0f, 0.0f, 0.0f);
|
||||||
int inv = invert;
|
int inv = invert;
|
||||||
if (i == 2) {
|
if (i == 2) {
|
||||||
|
@ -191,7 +191,6 @@ NODE_SHADER_MATERIALX_BEGIN
|
|||||||
#endif
|
#endif
|
||||||
NODE_SHADER_MATERIALX_END
|
NODE_SHADER_MATERIALX_END
|
||||||
|
|
||||||
|
|
||||||
} // namespace blender::nodes::node_shader_vector_transform_cc
|
} // namespace blender::nodes::node_shader_vector_transform_cc
|
||||||
|
|
||||||
void register_node_type_sh_vect_transform()
|
void register_node_type_sh_vect_transform()
|
||||||
|
Loading…
Reference in New Issue
Block a user