Blender V5.0
node_geo_input_spline_resolution.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#include "BKE_curves.hh"
6
8
10
12{
13 b.add_output<decl::Int>("Resolution").field_source();
14}
15
17 public:
18 ResolutionFieldInput() : bke::CurvesFieldInput(CPPType::get<int>(), "Resolution")
19 {
21 }
22
24 const AttrDomain domain,
25 const IndexMask & /*mask*/) const final
26 {
27 return curves.adapt_domain(curves.resolution(), AttrDomain::Curve, domain);
28 }
29
31 {
32 return 82713465872345682;
33 }
34
35 bool is_equal_to(const fn::FieldNode &other) const final
36 {
37 return dynamic_cast<const ResolutionFieldInput *>(&other) != nullptr;
38 }
39
40 std::optional<AttrDomain> preferred_domain(const bke::CurvesGeometry & /*curves*/) const final
41 {
42 return AttrDomain::Curve;
43 }
44};
45
47{
48 params.set_output("Resolution", Field<int>(std::make_shared<ResolutionFieldInput>()));
49}
50
51static void node_register()
52{
53 static blender::bke::bNodeType ntype;
54
56 &ntype, "GeometryNodeInputSplineResolution", GEO_NODE_INPUT_SPLINE_RESOLUTION);
57 ntype.ui_name = "Spline Resolution";
58 ntype.ui_description =
59 "Retrieve the number of evaluated points that will be generated for every control point on "
60 "curves";
61 ntype.enum_name_legacy = "INPUT_SPLINE_RESOLUTION";
64 ntype.declare = node_declare;
66}
68
69} // namespace blender::nodes::node_geo_input_spline_resolution_cc
Low-level operations for curves.
#define NODE_CLASS_INPUT
Definition BKE_node.hh:447
#define GEO_NODE_INPUT_SPLINE_RESOLUTION
#define final(a, b, c)
Definition BLI_hash.h:19
#define NOD_REGISTER_NODE(REGISTER_FUNC)
unsigned long long int uint64_t
GVArray get_varray_for_context(const bke::CurvesGeometry &curves, const AttrDomain domain, const IndexMask &) const final
std::optional< AttrDomain > preferred_domain(const bke::CurvesGeometry &) const final
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void node_register_type(bNodeType &ntype)
Definition node.cc:2416
void geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
Defines a node type.
Definition BKE_node.hh:238
std::string ui_description
Definition BKE_node.hh:244
NodeGeometryExecFunction geometry_node_execute
Definition BKE_node.hh:354
const char * enum_name_legacy
Definition BKE_node.hh:247
NodeDeclareFunction declare
Definition BKE_node.hh:362