Blender  V3.3
Classes | Functions
blender::nodes::node_geo_curve_sample_cc Namespace Reference

Classes

class  SampleFloatSegmentsFunction
 
class  SampleCurveFunction
 

Functions

static void node_declare (NodeDeclarationBuilder &b)
 
static void node_layout (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 
static void node_type_init (bNodeTree *UNUSED(tree), bNode *node)
 
static void node_update (bNodeTree *ntree, bNode *node)
 
static void sample_indices_and_lengths (const Span< float > accumulated_lengths, const Span< float > sample_lengths, const IndexMask mask, MutableSpan< int > r_segment_indices, MutableSpan< float > r_length_in_segment)
 
static void sample_indices_and_factors_to_compressed (const Span< float > accumulated_lengths, const Span< float > sample_lengths, const IndexMask mask, MutableSpan< int > r_segment_indices, MutableSpan< float > r_factor_in_segment)
 
static Field< floatget_length_input_field (GeoNodeExecParams params, const GeometryNodeCurveSampleMode mode, const float curves_total_length)
 
static Array< floatcurve_accumulated_lengths (const bke::CurvesGeometry &curves)
 
static void node_geo_exec (GeoNodeExecParams params)
 

Function Documentation

◆ curve_accumulated_lengths()

static Array<float> blender::nodes::node_geo_curve_sample_cc::curve_accumulated_lengths ( const bke::CurvesGeometry curves)
static

Definition at line 302 of file node_geo_curve_sample.cc.

References curves, and blender::math::length().

Referenced by node_geo_exec().

◆ get_length_input_field()

static Field<float> blender::nodes::node_geo_curve_sample_cc::get_length_input_field ( GeoNodeExecParams  params,
const GeometryNodeCurveSampleMode  mode,
const float  curves_total_length 
)
static

Pre-process the lengths or factors used for the sampling, turning factors into lengths, and clamping between zero and the total length of the curves. Do this as a separate operation in the field tree to make the sampling simpler, and to let the evaluator optimize better.

Todo:
Use a mutable single input instead when they are supported.

Definition at line 284 of file node_geo_curve_sample.cc.

References blender::fn::FieldOperation::Create(), GEO_NODE_CURVE_SAMPLE_LENGTH, and params.

Referenced by node_geo_exec().

◆ node_declare()

static void blender::nodes::node_geo_curve_sample_cc::node_declare ( NodeDeclarationBuilder b)
static

◆ node_geo_exec()

static void blender::nodes::node_geo_curve_sample_cc::node_geo_exec ( GeoNodeExecParams  params)
static

◆ node_layout()

static void blender::nodes::node_geo_curve_sample_cc::node_layout ( uiLayout layout,
bContext UNUSEDC,
PointerRNA ptr 
)
static

Definition at line 38 of file node_geo_curve_sample.cc.

References ptr, UI_ITEM_R_EXPAND, and uiItemR().

Referenced by register_node_type_geo_curve_sample().

◆ node_type_init()

static void blender::nodes::node_geo_curve_sample_cc::node_type_init ( bNodeTree UNUSEDtree,
bNode node 
)
static

Definition at line 43 of file node_geo_curve_sample.cc.

References data, GEO_NODE_CURVE_SAMPLE_LENGTH, and node.

Referenced by register_node_type_geo_curve_sample().

◆ node_update()

static void blender::nodes::node_geo_curve_sample_cc::node_update ( bNodeTree ntree,
bNode node 
)
static

◆ sample_indices_and_factors_to_compressed()

static void blender::nodes::node_geo_curve_sample_cc::sample_indices_and_factors_to_compressed ( const Span< float accumulated_lengths,
const Span< float sample_lengths,
const IndexMask  mask,
MutableSpan< int >  r_segment_indices,
MutableSpan< float r_factor_in_segment 
)
static

◆ sample_indices_and_lengths()

static void blender::nodes::node_geo_curve_sample_cc::sample_indices_and_lengths ( const Span< float accumulated_lengths,
const Span< float sample_lengths,
const IndexMask  mask,
MutableSpan< int >  r_segment_indices,
MutableSpan< float r_length_in_segment 
)
static