Differential D16858 Diff 58905 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
| /* SPDX-License-Identifier: GPL-2.0-or-later */ | /* SPDX-License-Identifier: GPL-2.0-or-later */ | ||||
| #include "BKE_curves.hh" | #include "BKE_curves.hh" | ||||
| #include "node_geometry_util.hh" | #include "node_geometry_util.hh" | ||||
| namespace blender::nodes::node_geo_set_spline_resolution_cc { | namespace blender::nodes::node_geo_set_spline_resolution_cc { | ||||
| static void node_declare(NodeDeclarationBuilder &b) | static void node_declare(NodeDeclarationBuilder &b) | ||||
| { | { | ||||
| b.add_input<decl::Geometry>(N_("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>(N_("Selection")).default_value(true).hide_value().supports_field(); | b.add_input<decl::Bool>(N_("Selection")).default_value(true).hide_value().field_on_auto(); | ||||
| b.add_input<decl::Int>(N_("Resolution")).min(1).default_value(12).supports_field(); | b.add_input<decl::Int>(N_("Resolution")).min(1).default_value(12).field_on_auto(); | ||||
| b.add_output<decl::Geometry>(N_("Geometry")); | b.add_output<decl::Geometry>(N_("Geometry")).propagate_from_auto(); | ||||
| } | } | ||||
| static void set_resolution(bke::CurvesGeometry &curves, | static void set_resolution(bke::CurvesGeometry &curves, | ||||
| const Field<bool> &selection_field, | const Field<bool> &selection_field, | ||||
| const Field<int> &resolution_field) | const Field<int> &resolution_field) | ||||
| { | { | ||||
| if (curves.curves_num() == 0) { | if (curves.curves_num() == 0) { | ||||
| return; | return; | ||||
| ▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines | |||||