Blender  V3.3
Classes | Functions
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 *UNUSED(tree), bNode *node)
 
static void node_layout (uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
 
Utility Functions
static Map< AttributeIDRef, AttributeKindgather_attributes_without_id (const GeometrySet &geometry_set, const GeometryComponentType component_type)
 
static IndexRange range_for_offsets_index (const Span< int > offsets, const int index)
 
static Array< int > accumulate_counts_to_offsets (const IndexMask selection, const VArray< int > &counts)
 
template<typename T >
static void threaded_slice_fill (Span< int > offsets, const IndexMask selection, Span< T > src, MutableSpan< T > dst)
 
template<typename T >
static void threaded_mapped_copy (const Span< int > mapping, const Span< T > src, MutableSpan< T > dst)
 
static void copy_hashed_ids (const Span< int > src, const int hash, MutableSpan< int > dst)
 
static void threaded_id_offset_copy (const Span< int > offsets, const Span< int > src, MutableSpan< int > dst)
 
static void create_duplicate_index_attribute (bke::MutableAttributeAccessor attributes, const eAttrDomain output_domain, const IndexMask selection, const IndexAttributes &attribute_outputs, const Span< int > offsets)
 
static void copy_stable_id_point (const Span< int > offsets, const bke::AttributeAccessor src_attributes, bke::MutableAttributeAccessor dst_attributes)
 
static void copy_attributes_without_id (GeometrySet &geometry_set, const GeometryComponentType component_type, const eAttrDomain domain, const Span< int > offsets, const IndexMask selection, const bke::AttributeAccessor src_attributes, bke::MutableAttributeAccessor dst_attributes)
 
Duplicate Curves
static void copy_curve_attributes_without_id (const GeometrySet &geometry_set, const bke::CurvesGeometry &src_curves, const IndexMask selection, const Span< int > curve_offsets, bke::CurvesGeometry &dst_curves)
 
static void copy_stable_id_curves (const bke::CurvesGeometry &src_curves, const IndexMask selection, const Span< int > curve_offsets, bke::CurvesGeometry &dst_curves)
 
static void duplicate_curves (GeometrySet &geometry_set, const Field< int > &count_field, const Field< bool > &selection_field, const IndexAttributes &attribute_outputs)
 
Duplicate Faces
static void copy_face_attributes_without_id (GeometrySet &geometry_set, const Span< int > edge_mapping, const Span< int > vert_mapping, const Span< int > loop_mapping, const Span< int > offsets, const IndexMask selection, const bke::AttributeAccessor src_attributes, bke::MutableAttributeAccessor dst_attributes)
 
static void copy_stable_id_faces (const Mesh &mesh, const IndexMask selection, const Span< int > poly_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)
 
Duplicate Edges
static void copy_edge_attributes_without_id (GeometrySet &geometry_set, const Span< int > point_mapping, const Span< int > offsets, const IndexMask selection, const bke::AttributeAccessor src_attributes, bke::MutableAttributeAccessor dst_attributes)
 
static void copy_stable_id_edges (const Mesh &mesh, const IndexMask selection, const Span< int > edge_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)
 
Duplicate Points (Curves)
static void duplicate_points_curve (GeometrySet &geometry_set, const Field< int > &count_field, const Field< bool > &selection_field, const IndexAttributes &attribute_outputs)
 
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)
 
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)
 
Duplicate Points
static void duplicate_points (GeometrySet &geometry_set, const Field< int > &count_field, const Field< bool > &selection_field, const IndexAttributes &attribute_outputs)
 
Duplicate Instances
static void duplicate_instances (GeometrySet &geometry_set, const Field< int > &count_field, const Field< bool > &selection_field, const IndexAttributes &attribute_outputs)
 
Entry Point
static void node_geo_exec (GeoNodeExecParams params)
 

Function Documentation

◆ accumulate_counts_to_offsets()

static Array<int> blender::nodes::node_geo_duplicate_elements_cc::accumulate_counts_to_offsets ( const IndexMask  selection,
const VArray< int > &  counts 
)
static

◆ copy_attributes_without_id()

static void blender::nodes::node_geo_duplicate_elements_cc::copy_attributes_without_id ( GeometrySet geometry_set,
const GeometryComponentType  component_type,
const eAttrDomain  domain,
const Span< int >  offsets,
const IndexMask  selection,
const bke::AttributeAccessor  src_attributes,
bke::MutableAttributeAccessor  dst_attributes 
)
static

◆ copy_curve_attributes_without_id()

static void blender::nodes::node_geo_duplicate_elements_cc::copy_curve_attributes_without_id ( const GeometrySet geometry_set,
const bke::CurvesGeometry src_curves,
const IndexMask  selection,
const Span< int >  curve_offsets,
bke::CurvesGeometry dst_curves 
)
static

◆ copy_edge_attributes_without_id()

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

◆ copy_face_attributes_without_id()

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

◆ 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

Definition at line 117 of file node_geo_duplicate_elements.cc.

References hash, and src.

◆ 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 Span< int >  curve_offsets,
bke::CurvesGeometry dst_curves 
)
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. In the curve case, copy the entire curve's points to the destination, then loop over the remaining ones point by point, hashing their ids to the new ids.

Definition at line 291 of file node_geo_duplicate_elements.cc.

References ATTR_DOMAIN_POINT, blender::bke::CurvesGeometry::attributes(), blender::bke::CurvesGeometry::attributes_for_write(), CD_PROP_INT32, blender::IndexMask::index_range(), blender::bke::AttributeAccessor::lookup(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), blender::threading::parallel_for(), blender::bke::GSpanAttributeWriter::span, src, blender::GMutableSpan::typed(), blender::GVArray::typed(), and blender::bke::GAttributeReader::varray.

◆ copy_stable_id_edges()

static void blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_edges ( const Mesh mesh,
const IndexMask  selection,
const Span< int >  edge_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 Span< int >  poly_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 470 of file node_geo_duplicate_elements.cc.

References ATTR_DOMAIN_POINT, CD_PROP_INT32, blender::bke::GSpanAttributeWriter::finish(), hash, blender::IndexMask::index_range(), blender::bke::AttributeAccessor::lookup(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), mesh, Mesh::mpoly, range_for_offsets_index(), blender::IndexRange::size(), blender::bke::GSpanAttributeWriter::span, src, MPoly::totloop, Mesh::totpoly, blender::GMutableSpan::typed(), blender::GVArray::typed(), and blender::bke::GAttributeReader::varray.

Referenced by duplicate_faces().

◆ copy_stable_id_point()

static void blender::nodes::node_geo_duplicate_elements_cc::copy_stable_id_point ( const Span< 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 eAttrDomain  output_domain,
const IndexMask  selection,
const IndexAttributes attribute_outputs,
const Span< 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 
)
static

◆ 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 
)
static

◆ duplicate_faces()

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

◆ duplicate_instances()

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

◆ duplicate_points()

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

◆ 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 
)
static

◆ duplicate_points_mesh()

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

◆ duplicate_points_pointcloud()

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

◆ gather_attributes_without_id()

static Map<AttributeIDRef, AttributeKind> blender::nodes::node_geo_duplicate_elements_cc::gather_attributes_without_id ( const GeometrySet geometry_set,
const GeometryComponentType  component_type 
)
static

◆ node_declare()

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

◆ node_geo_exec()

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

◆ node_init()

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

Definition at line 43 of file node_geo_duplicate_elements.cc.

References ATTR_DOMAIN_POINT, data, and node.

◆ node_layout()

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

Definition at line 50 of file node_geo_duplicate_elements.cc.

References ptr, and uiItemR().

Referenced by register_node_type_geo_duplicate_elements().

◆ NODE_STORAGE_FUNCS()

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

◆ range_for_offsets_index()

static IndexRange blender::nodes::node_geo_duplicate_elements_cc::range_for_offsets_index ( const Span< int >  offsets,
const int  index 
)
static

◆ threaded_id_offset_copy()

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

◆ threaded_mapped_copy()

template<typename T >
static void blender::nodes::node_geo_duplicate_elements_cc::threaded_mapped_copy ( const Span< int >  mapping,
const Span< T src,
MutableSpan< T dst 
)
static

◆ threaded_slice_fill()

template<typename T >
static void blender::nodes::node_geo_duplicate_elements_cc::threaded_slice_fill ( Span< int >  offsets,
const IndexMask  selection,
Span< T src,
MutableSpan< T dst 
)
static