22 curves.ensure_evaluated_lengths();
24 float total_length = 0.0f;
25 for (
const int i : curves.curves_range()) {
26 total_length += curves.evaluated_length_total_for_curve(i, cyclic[i]);
41 using namespace bke::greasepencil;
43 for (
const int layer_index : grease_pencil.layers().index_range()) {
44 const Drawing *drawing = grease_pencil.get_eval_drawing(grease_pencil.layer(layer_index));
45 if (drawing ==
nullptr) {
53 params.set_default_remaining_outputs();
57 params.set_output(
"Length", length);
Low-level operations for curves.
Low-level operations for grease pencil.
#define NODE_CLASS_GEOMETRY
#define NOD_REGISTER_NODE(REGISTER_FUNC)
const bke::CurvesGeometry & strokes() const
local_group_size(16, 16) .push_constant(Type b
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, int type, const char *name, short nclass)
const GreasePencil * get_grease_pencil() const
const Curves * get_curves() const
bool has_grease_pencil() const
NodeGeometryExecFunction geometry_node_execute
NodeDeclareFunction declare