Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_set_curve_tilt.cc
| Show All 14 Lines | |||||
| */ | */ | ||||
| #include "node_geometry_util.hh" | #include "node_geometry_util.hh" | ||||
| namespace blender::nodes { | namespace blender::nodes { | ||||
| static void geo_node_set_curve_tilt_declare(NodeDeclarationBuilder &b) | static void geo_node_set_curve_tilt_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::Geometry>("Curve").supported_type(GEO_COMPONENT_TYPE_CURVE); | b.add_input<decl::Geometry>(N_("Curve")).supported_type(GEO_COMPONENT_TYPE_CURVE); | ||||
| b.add_input<decl::Bool>("Selection").default_value(true).hide_value().supports_field(); | b.add_input<decl::Bool>(N_("Selection")).default_value(true).hide_value().supports_field(); | ||||
| b.add_input<decl::Float>("Tilt").subtype(PROP_ANGLE).supports_field(); | b.add_input<decl::Float>(N_("Tilt")).subtype(PROP_ANGLE).supports_field(); | ||||
| b.add_output<decl::Geometry>("Curve"); | b.add_output<decl::Geometry>(N_("Curve")); | ||||
| } | } | ||||
| static void set_tilt_in_component(GeometryComponent &component, | static void set_tilt_in_component(GeometryComponent &component, | ||||
| const Field<bool> &selection_field, | const Field<bool> &selection_field, | ||||
| const Field<float> &tilt_field) | const Field<float> &tilt_field) | ||||
| { | { | ||||
| GeometryComponentFieldContext field_context{component, ATTR_DOMAIN_POINT}; | GeometryComponentFieldContext field_context{component, ATTR_DOMAIN_POINT}; | ||||
| const int domain_size = component.attribute_domain_size(ATTR_DOMAIN_POINT); | const int domain_size = component.attribute_domain_size(ATTR_DOMAIN_POINT); | ||||
| ▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines | |||||