Blender V4.3
blender::nodes::node_geo_duplicate_elements_cc Namespace Reference

Classes

struct  IndexAttributes
 

Functions

 NODE_STORAGE_FUNCS (NodeGeometryDuplicateElements)
 
static void node_declare (NodeDeclarationBuilder &b)
 
static void node_init (bNodeTree *, bNode *node)
 
static void node_layout (uiLayout *layout, bContext *, PointerRNA *ptr)
 
static void node_rna (StructRNA *srna)
 
static void node_register ()
 
Utility Functions
static OffsetIndices< intaccumulate_counts_to_offsets (const IndexMask &selection, const VArray< int > &counts, Array< int > &r_offset_data)
 
static void copy_hashed_ids (const Span< int > src, const int hash, MutableSpan< int > dst)
 
static void threaded_id_offset_copy (const OffsetIndices< int > offsets, const Span< int > src, MutableSpan< int > all_dst)
 
static void create_duplicate_index_attribute (bke::MutableAttributeAccessor attributes, const AttrDomain output_domain, const IndexMask &selection, const IndexAttributes &attribute_outputs, const OffsetIndices< int > offsets)
 
static void copy_stable_id_point (const OffsetIndices< int > offsets, const bke::AttributeAccessor src_attributes, bke::MutableAttributeAccessor dst_attributes)
 
Duplicate Curves
static void copy_curve_attributes_without_id (const bke::CurvesGeometry &src_curves, const IndexMask &selection, const OffsetIndices< int > curve_offsets, const AttributeFilter &attribute_filter, bke::CurvesGeometry &dst_curves)
 
static void copy_stable_id_curves (const bke::CurvesGeometry &src_curves, const IndexMask &selection, const OffsetIndices< int > offsets, bke::CurvesGeometry &dst_curves)
 
static bke::CurvesGeometry duplicate_curves_CurveGeometry (const bke::CurvesGeometry &curves, const FieldContext &field_context, const Field< int > &count_field, const Field< bool > &selection_field, const IndexAttributes &attribute_outputs, const AttributeFilter &attribute_filter)
 
static void duplicate_curves (GeometrySet &geometry_set, const Field< int > &count_field, const Field< bool > &selection_field, const IndexAttributes &attribute_outputs, const AttributeFilter &attribute_filter)
 
Duplicate Faces
static void copy_face_attributes_without_id (const Span< int > edge_mapping, const Span< int > vert_mapping, const Span< int > loop_mapping, const OffsetIndices< int > offsets, const IndexMask &selection, const AttributeFilter &attribute_filter, const bke::AttributeAccessor src_attributes, bke::MutableAttributeAccessor dst_attributes)
 
static void copy_stable_id_faces (const Mesh &mesh, const IndexMask &selection, const OffsetIndices< int > face_offsets, const Span< int > vert_mapping, const bke::AttributeAccessor src_attributes, bke::MutableAttributeAccessor dst_attributes)
 
static void duplicate_faces (GeometrySet &geometry_set, const Field< int > &count_field, const Field< bool > &selection_field, const IndexAttributes &attribute_outputs, const AttributeFilter &attribute_filter)
 
Duplicate Edges
static void copy_edge_attributes_without_id (const Span< int > point_mapping, const OffsetIndices< int > offsets, const IndexMask &selection, const AttributeFilter &attribute_filter, const bke::AttributeAccessor src_attributes, bke::MutableAttributeAccessor dst_attributes)
 
static void copy_stable_id_edges (const Mesh &mesh, const IndexMask &selection, const OffsetIndices< int > offsets, const bke::AttributeAccessor src_attributes, bke::MutableAttributeAccessor dst_attributes)
 
static void duplicate_edges (GeometrySet &geometry_set, const Field< int > &count_field, const Field< bool > &selection_field, const IndexAttributes &attribute_outputs, const AttributeFilter &attribute_filter)
 
Duplicate Points (Curves)
static bke::CurvesGeometry duplicate_points_CurvesGeometry (const bke::CurvesGeometry &src_curves, const FieldContext &field_context, const Field< int > &count_field, const Field< bool > &selection_field, const IndexAttributes &attribute_outputs, const AttributeFilter &attribute_filter)
 
static void duplicate_points_curve (GeometrySet &geometry_set, const Field< int > &count_field, const Field< bool > &selection_field, const IndexAttributes &attribute_outputs, const AttributeFilter &attribute_filter)
 
Duplicate Points (Grease Pencil)
static void duplicate_points_grease_pencil (GeometrySet &geometry_set, const Field< int > &count_field, const Field< bool > &selection_field, const IndexAttributes &attribute_outputs, const AttributeFilter &attribute_filter)
 
Duplicate Points (Mesh)
static void duplicate_points_mesh (GeometrySet &geometry_set, const Field< int > &count_field, const Field< bool > &selection_field, const IndexAttributes &attribute_outputs, const AttributeFilter &attribute_filter)
 
Duplicate Points (Point Cloud)
static void duplicate_points_pointcloud (GeometrySet &geometry_set, const Field< int > &count_field, const Field< bool > &selection_field, const IndexAttributes &attribute_outputs, const AttributeFilter &attribute_filter)
 
Duplicate Points
static void duplicate_points (GeometrySet &geometry_set, const Field< int > &count_field, const Field< bool > &selection_field, const IndexAttributes &attribute_outputs, const AttributeFilter &attribute_filter)
 
Duplicate Layers
static void duplicate_layers (GeometrySet &geometry_set, const Field< int > &count_field, const Field< bool > &selection_field, const IndexAttributes &attribute_outputs, const AttributeFilter &attribute_filter)
 
Duplicate Instances
static void duplicate_instances (GeometrySet &geometry_set, const Field< int > &count_field, const Field< bool > &selection_field, const IndexAttributes &attribute_outputs, const AttributeFilter &attribute_filter)
 
Entry Point
static void node_geo_exec (GeoNodeExecParams params)
 

Function Documentation

◆ accumulate_counts_to_offsets()

◆ copy_curve_attributes_without_id()

static void blender::nodes::node_geo_duplicate_elements_cc::copy_curve_attributes_without_id ( const bke::CurvesGeometry & src_curves,
const IndexMask & selection,
const OffsetIndices< int > curve_offsets,
const AttributeFilter & attribute_filter,
bke::CurvesGeometry & dst_curves )
static

Copies the attributes for curve duplicates. If copying the curve domain, the attributes are copied with an offset fill, otherwise a mapping is used.

Definition at line 160 of file node_geo_duplicate_elements.cc.

References ATTR_DOMAIN_MASK_ALL, blender::bke::CurvesGeometry::attributes(), blender::bke::CurvesGeometry::attributes_for_write(), BLI_assert_unreachable, copy_curve_attributes_without_id(), and blender::bke::CurvesGeometry::points_by_curve().

Referenced by copy_curve_attributes_without_id(), and duplicate_curves_CurveGeometry().

◆ copy_edge_attributes_without_id()

static void blender::nodes::node_geo_duplicate_elements_cc::copy_edge_attributes_without_id ( const Span< int > point_mapping,
const OffsetIndices< int > offsets,
const IndexMask & selection,
const AttributeFilter & attribute_filter,
const bke::AttributeAccessor src_attributes,
bke::MutableAttributeAccessor dst_attributes )
static

Copies the attributes for edge duplicates. If copying the edge domain, the attributes are copied with an offset fill, for point domain a mapping is used.

Definition at line 573 of file node_geo_duplicate_elements.cc.

References ATTR_DOMAIN_MASK_EDGE, ATTR_DOMAIN_MASK_POINT, BLI_assert_unreachable, and copy_edge_attributes_without_id().

Referenced by copy_edge_attributes_without_id().

◆ copy_face_attributes_without_id()

static void blender::nodes::node_geo_duplicate_elements_cc::copy_face_attributes_without_id ( const Span< int > edge_mapping,
const Span< int > vert_mapping,
const Span< int > loop_mapping,
const OffsetIndices< int > offsets,
const IndexMask & selection,
const AttributeFilter & attribute_filter,
const bke::AttributeAccessor src_attributes,
bke::MutableAttributeAccessor dst_attributes )
static

Copies the attributes for face duplicates. If copying the face domain, the attributes are copied with an offset fill, otherwise a mapping is used.

Definition at line 369 of file node_geo_duplicate_elements.cc.

References ATTR_DOMAIN_MASK_ALL, BLI_assert_unreachable, and copy_face_attributes_without_id().

Referenced by copy_face_attributes_without_id(), and duplicate_faces().

◆ copy_hashed_ids()

static void blender::nodes::node_geo_duplicate_elements_cc::copy_hashed_ids ( const Span< int > src,
const int hash,
MutableSpan< int > dst )
static

◆ copy_stable_id_curves()

static void blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_curves ( const bke::CurvesGeometry & src_curves,
const IndexMask & selection,
const OffsetIndices< int > offsets,
bke::CurvesGeometry & dst_curves )
static

◆ copy_stable_id_edges()

static void blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_edges ( const Mesh & mesh,
const IndexMask & selection,
const OffsetIndices< int > offsets,
const bke::AttributeAccessor src_attributes,
bke::MutableAttributeAccessor dst_attributes )
static

◆ copy_stable_id_faces()

static void blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_faces ( const Mesh & mesh,
const IndexMask & selection,
const OffsetIndices< int > face_offsets,
const Span< int > vert_mapping,
const bke::AttributeAccessor src_attributes,
bke::MutableAttributeAccessor dst_attributes )
static

Copy the stable ids to the first duplicate and create new ids based on a hash of the original id and the duplicate number. This function is used for points when duplicating the face domain.

This function could be threaded in the future, but since it is only 1 attribute and the face->edge->vert mapping would mean creating a 1/1 mapping to allow for it, is it worth it?

Definition at line 414 of file node_geo_duplicate_elements.cc.

References CD_PROP_INT32, copy_stable_id_faces(), blender::bke::GSpanAttributeWriter::finish(), blender::bke::AttributeAccessor::lookup(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), blender::IndexRange::size(), blender::bke::GSpanAttributeWriter::span, blender::GMutableSpan::typed(), blender::GVArray::typed(), and blender::bke::GAttributeReader::varray.

Referenced by copy_stable_id_faces(), and duplicate_faces().

◆ copy_stable_id_point()

static void blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_point ( const OffsetIndices< int > offsets,
const bke::AttributeAccessor src_attributes,
bke::MutableAttributeAccessor dst_attributes )
static

◆ create_duplicate_index_attribute()

static void blender::nodes::node_geo_duplicate_elements_cc::create_duplicate_index_attribute ( bke::MutableAttributeAccessor attributes,
const AttrDomain output_domain,
const IndexMask & selection,
const IndexAttributes & attribute_outputs,
const OffsetIndices< int > offsets )
static

◆ duplicate_curves()

static void blender::nodes::node_geo_duplicate_elements_cc::duplicate_curves ( GeometrySet & geometry_set,
const Field< int > & count_field,
const Field< bool > & selection_field,
const IndexAttributes & attribute_outputs,
const AttributeFilter & attribute_filter )
static

◆ duplicate_curves_CurveGeometry()

◆ duplicate_edges()

static void blender::nodes::node_geo_duplicate_elements_cc::duplicate_edges ( GeometrySet & geometry_set,
const Field< int > & count_field,
const Field< bool > & selection_field,
const IndexAttributes & attribute_outputs,
const AttributeFilter & attribute_filter )
static

◆ duplicate_faces()

◆ duplicate_instances()

◆ duplicate_layers()

◆ duplicate_points()

◆ duplicate_points_curve()

static void blender::nodes::node_geo_duplicate_elements_cc::duplicate_points_curve ( GeometrySet & geometry_set,
const Field< int > & count_field,
const Field< bool > & selection_field,
const IndexAttributes & attribute_outputs,
const AttributeFilter & attribute_filter )
static

◆ duplicate_points_CurvesGeometry()

static bke::CurvesGeometry blender::nodes::node_geo_duplicate_elements_cc::duplicate_points_CurvesGeometry ( const bke::CurvesGeometry & src_curves,
const FieldContext & field_context,
const Field< int > & count_field,
const Field< bool > & selection_field,
const IndexAttributes & attribute_outputs,
const AttributeFilter & attribute_filter )
static

◆ duplicate_points_grease_pencil()

static void blender::nodes::node_geo_duplicate_elements_cc::duplicate_points_grease_pencil ( GeometrySet & geometry_set,
const Field< int > & count_field,
const Field< bool > & selection_field,
const IndexAttributes & attribute_outputs,
const AttributeFilter & attribute_filter )
static

◆ duplicate_points_mesh()

◆ duplicate_points_pointcloud()

◆ node_declare()

static void blender::nodes::node_geo_duplicate_elements_cc::node_declare ( NodeDeclarationBuilder & b)
static

◆ node_geo_exec()

◆ node_init()

static void blender::nodes::node_geo_duplicate_elements_cc::node_init ( bNodeTree * ,
bNode * node )
static

Definition at line 47 of file node_geo_duplicate_elements.cc.

References data.

Referenced by node_register().

◆ node_layout()

static void blender::nodes::node_geo_duplicate_elements_cc::node_layout ( uiLayout * layout,
bContext * ,
PointerRNA * ptr )
static

Definition at line 54 of file node_geo_duplicate_elements.cc.

References ptr, UI_ITEM_NONE, and uiItemR().

Referenced by node_register().

◆ node_register()

◆ node_rna()

static void blender::nodes::node_geo_duplicate_elements_cc::node_rna ( StructRNA * srna)
static

◆ NODE_STORAGE_FUNCS()

blender::nodes::node_geo_duplicate_elements_cc::NODE_STORAGE_FUNCS ( NodeGeometryDuplicateElements )

◆ threaded_id_offset_copy()

static void blender::nodes::node_geo_duplicate_elements_cc::threaded_id_offset_copy ( const OffsetIndices< int > offsets,
const Span< int > src,
MutableSpan< int > all_dst )
static