Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_transform.cc
| Show All 31 Lines | |||||
| #include "DEG_depsgraph_query.h" | #include "DEG_depsgraph_query.h" | ||||
| #include "node_geometry_util.hh" | #include "node_geometry_util.hh" | ||||
| namespace blender::nodes { | namespace blender::nodes { | ||||
| static void geo_node_transform_declare(NodeDeclarationBuilder &b) | static void geo_node_transform_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::Geometry>("Geometry"); | b.add_input<decl::Geometry>(N_("Geometry")); | ||||
| b.add_input<decl::Vector>("Translation").subtype(PROP_TRANSLATION); | b.add_input<decl::Vector>(N_("Translation")).subtype(PROP_TRANSLATION); | ||||
| b.add_input<decl::Vector>("Rotation").subtype(PROP_EULER); | b.add_input<decl::Vector>(N_("Rotation")).subtype(PROP_EULER); | ||||
| b.add_input<decl::Vector>("Scale").default_value({1, 1, 1}).subtype(PROP_XYZ); | b.add_input<decl::Vector>(N_("Scale")).default_value({1, 1, 1}).subtype(PROP_XYZ); | ||||
| b.add_output<decl::Geometry>("Geometry"); | b.add_output<decl::Geometry>(N_("Geometry")); | ||||
| } | } | ||||
| static bool use_translate(const float3 rotation, const float3 scale) | static bool use_translate(const float3 rotation, const float3 scale) | ||||
| { | { | ||||
| if (compare_ff(rotation.length_squared(), 0.0f, 1e-9f) != 1) { | if (compare_ff(rotation.length_squared(), 0.0f, 1e-9f) != 1) { | ||||
| return false; | return false; | ||||
| } | } | ||||
| if (compare_ff(scale.x, 1.0f, 1e-9f) != 1 || compare_ff(scale.y, 1.0f, 1e-9f) != 1 || | if (compare_ff(scale.x, 1.0f, 1e-9f) != 1 || compare_ff(scale.y, 1.0f, 1e-9f) != 1 || | ||||
| ▲ Show 20 Lines • Show All 175 Lines • Show Last 20 Lines | |||||