15 .supported_type({GeometryComponent::Type::Curve, GeometryComponent::Type::GreasePencil})
16 .description(
"Curve to compute the length of");
25 float total_length = 0.0f;
44 for (
const int layer_index : grease_pencil.layers().index_range()) {
45 const Drawing *drawing = grease_pencil.get_eval_drawing(grease_pencil.layer(layer_index));
46 if (drawing ==
nullptr) {
54 params.set_default_remaining_outputs();
67 ntype.
ui_description =
"Retrieve the length of all splines added together";
Low-level operations for curves.
Low-level operations for grease pencil.
#define NODE_CLASS_GEOMETRY
#define GEO_NODE_CURVE_LENGTH
#define NOD_REGISTER_NODE(REGISTER_FUNC)
IndexRange curves_range() const
float evaluated_length_total_for_curve(int curve_index, bool cyclic) const
void ensure_evaluated_lengths() const
VArray< bool > cyclic() const
const bke::CurvesGeometry & strokes() const
float length(VecOp< float, D >) RET
void node_register_type(bNodeType &ntype)
static void node_register()
static void node_declare(NodeDeclarationBuilder &b)
static float curves_total_length(const bke::CurvesGeometry &curves)
static void node_geo_exec(GeoNodeExecParams params)
void geo_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
const GreasePencil * get_grease_pencil() const
const Curves * get_curves() const
bool has_grease_pencil() const
std::string ui_description
NodeGeometryExecFunction geometry_node_execute
const char * enum_name_legacy
NodeDeclareFunction declare