Differential D13033 Diff 44115 source/blender/nodes/geometry/nodes/node_geo_set_spline_resolution.cc
Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/geometry/nodes/node_geo_set_spline_resolution.cc
| Show All 16 Lines | |||||
| #include "BKE_spline.hh" | #include "BKE_spline.hh" | ||||
| #include "node_geometry_util.hh" | #include "node_geometry_util.hh" | ||||
| namespace blender::nodes { | namespace blender::nodes { | ||||
| static void geo_node_set_spline_resolution_declare(NodeDeclarationBuilder &b) | static void geo_node_set_spline_resolution_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::Geometry>("Geometry").supported_type(GEO_COMPONENT_TYPE_CURVE); | b.add_input<decl::Geometry>(N_("Geometry")).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::Int>("Resolution").default_value(12).supports_field(); | b.add_input<decl::Int>(N_("Resolution")).default_value(12).supports_field(); | ||||
| b.add_output<decl::Geometry>("Geometry"); | b.add_output<decl::Geometry>(N_("Geometry")); | ||||
| } | } | ||||
| static void set_resolution_in_component(GeometryComponent &component, | static void set_resolution_in_component(GeometryComponent &component, | ||||
| const Field<bool> &selection_field, | const Field<bool> &selection_field, | ||||
| const Field<int> &resolution_field) | const Field<int> &resolution_field) | ||||
| { | { | ||||
| GeometryComponentFieldContext field_context{component, ATTR_DOMAIN_CURVE}; | GeometryComponentFieldContext field_context{component, ATTR_DOMAIN_CURVE}; | ||||
| const int domain_size = component.attribute_domain_size(ATTR_DOMAIN_CURVE); | const int domain_size = component.attribute_domain_size(ATTR_DOMAIN_CURVE); | ||||
| ▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines | |||||