Blender
V3.3
|
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, AttributeKind > | gather_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) |
|
static |
Definition at line 78 of file node_geo_duplicate_elements.cc.
References blender::IndexMask::index_range(), blender::Array< T, InlineBufferCapacity, Allocator >::last(), max, and blender::IndexMask::size().
Referenced by duplicate_edges(), duplicate_instances(), duplicate_points_curve(), duplicate_points_mesh(), and duplicate_points_pointcloud().
|
static |
Definition at line 186 of file node_geo_duplicate_elements.cc.
References blender::attribute_math::convert_to_static_type(), blender::bke::cpp_type_to_custom_data_type(), blender::bke::GAttributeReader::domain, blender::bke::GSpanAttributeWriter::finish(), gather_attributes_without_id(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::items(), blender::bke::AttributeAccessor::lookup(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), blender::bke::GSpanAttributeWriter::span, src, T, blender::GVArrayCommon::type(), blender::GMutableSpan::typed(), blender::GVArray::typed(), and blender::bke::GAttributeReader::varray.
Referenced by duplicate_instances(), duplicate_points_mesh(), and duplicate_points_pointcloud().
|
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 231 of file node_geo_duplicate_elements.cc.
References ATTR_DOMAIN_CURVE, ATTR_DOMAIN_POINT, blender::bke::CurvesGeometry::attributes(), blender::bke::CurvesGeometry::attributes_for_write(), blender::attribute_math::convert_to_static_type(), blender::bke::cpp_type_to_custom_data_type(), blender::bke::GAttributeReader::domain, gather_attributes_without_id(), GEO_COMPONENT_TYPE_CURVE, blender::IndexMask::index_range(), blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::items(), blender::bke::AttributeAccessor::lookup(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), blender::threading::parallel_for(), blender::bke::GSpanAttributeWriter::span, src, T, blender::GVArrayCommon::type(), blender::GMutableSpan::typed(), blender::GVArray::typed(), and blender::bke::GAttributeReader::varray.
|
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 629 of file node_geo_duplicate_elements.cc.
References ATTR_DOMAIN_EDGE, ATTR_DOMAIN_POINT, blender::attribute_math::convert_to_static_type(), blender::bke::cpp_type_to_custom_data_type(), blender::bke::GAttributeReader::domain, blender::bke::GSpanAttributeWriter::finish(), gather_attributes_without_id(), GEO_COMPONENT_TYPE_MESH, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::items(), blender::bke::AttributeAccessor::lookup(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), blender::bke::GSpanAttributeWriter::span, src, T, blender::GVArrayCommon::type(), blender::GMutableSpan::typed(), blender::GVArray::typed(), and blender::bke::GAttributeReader::varray.
|
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 409 of file node_geo_duplicate_elements.cc.
References ATTR_DOMAIN_CORNER, ATTR_DOMAIN_EDGE, ATTR_DOMAIN_FACE, ATTR_DOMAIN_POINT, blender::attribute_math::convert_to_static_type(), blender::bke::cpp_type_to_custom_data_type(), blender::bke::GAttributeReader::domain, blender::bke::GSpanAttributeWriter::finish(), gather_attributes_without_id(), GEO_COMPONENT_TYPE_MESH, blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::items(), blender::bke::AttributeAccessor::lookup(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), blender::bke::GSpanAttributeWriter::span, src, T, blender::GVArrayCommon::type(), blender::GMutableSpan::typed(), blender::GVArray::typed(), and blender::bke::GAttributeReader::varray.
Referenced by duplicate_faces().
|
static |
Definition at line 117 of file node_geo_duplicate_elements.cc.
|
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.
|
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 edge domain.
Definition at line 678 of file node_geo_duplicate_elements.cc.
References ATTR_DOMAIN_POINT, CD_PROP_INT32, blender::bke::AttributeAccessor::lookup(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), Mesh::medge, mesh, blender::threading::parallel_for(), blender::IndexMask::size(), blender::bke::GSpanAttributeWriter::span, src, Mesh::totedge, blender::GMutableSpan::typed(), blender::GVArray::typed(), and blender::bke::GAttributeReader::varray.
|
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().
|
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 the point domain elements.
Definition at line 166 of file node_geo_duplicate_elements.cc.
References ATTR_DOMAIN_POINT, CD_PROP_INT32, blender::bke::GSpanAttributeWriter::finish(), blender::bke::AttributeAccessor::lookup(), blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), blender::bke::GSpanAttributeWriter::span, src, threaded_id_offset_copy(), blender::GMutableSpan::typed(), blender::GVArray::typed(), and blender::bke::GAttributeReader::varray.
Referenced by duplicate_points_mesh(), and duplicate_points_pointcloud().
|
static |
Create the copy indices for the duplication domain.
Definition at line 144 of file node_geo_duplicate_elements.cc.
References blender::nodes::node_geo_duplicate_elements_cc::IndexAttributes::duplicate_index, blender::bke::SpanAttributeWriter< T >::finish(), indices, blender::bke::MutableAttributeAccessor::lookup_or_add_for_write_only_span(), range_for_offsets_index(), blender::IndexMask::size(), and blender::bke::SpanAttributeWriter< T >::span.
Referenced by duplicate_faces(), duplicate_instances(), duplicate_points_mesh(), and duplicate_points_pointcloud().
|
static |
Definition at line 325 of file node_geo_duplicate_elements.cc.
References ATTR_DOMAIN_CURVE, count, curves, blender::bke::curves_copy_parameters(), blender::bke::curves_new_nomain(), GEO_COMPONENT_TYPE_CURVE, Curves::geometry, GeometrySet::get_component_for_read(), CurveComponent::get_for_read(), GeometrySet::has_curves(), GeometrySet::keep_only_during_modify(), blender::Array< T, InlineBufferCapacity, Allocator >::last(), max, blender::bke::CurvesGeometry::offsets_for_write(), blender::threading::parallel_for(), GeometryComponentEditData::remember_deformed_curve_positions_if_necessary(), GeometrySet::remove_geometry_during_modify(), and blender::bke::image::partial_update::wrap().
Referenced by node_geo_exec().
|
static |
Definition at line 718 of file node_geo_duplicate_elements.cc.
References accumulate_counts_to_offsets(), ATTR_DOMAIN_EDGE, BKE_mesh_new_nomain(), GeometrySet::get_component_for_read(), MeshComponent::get_for_read(), GeometrySet::has_mesh(), blender::Array< T, InlineBufferCapacity, Allocator >::last(), Mesh::medge, mesh, Mesh::mvert, blender::threading::parallel_for(), GeometrySet::remove_geometry_during_modify(), blender::Span< T >::size(), Mesh::totedge, Mesh::totvert, and verts.
Referenced by blender::nodes::node_geo_extrude_mesh_cc::extrude_individual_mesh_faces(), blender::nodes::node_geo_extrude_mesh_cc::extrude_mesh_edges(), and node_geo_exec().
|
static |
Definition at line 514 of file node_geo_duplicate_elements.cc.
References blender::fn::FieldEvaluator::add(), ATTR_DOMAIN_FACE, BKE_mesh_new_nomain(), copy_face_attributes_without_id(), copy_stable_id_faces(), count, create_duplicate_index_attribute(), blender::nodes::node_geo_duplicate_elements_cc::IndexAttributes::duplicate_index, MLoop::e, blender::fn::FieldEvaluator::evaluate(), GEO_COMPONENT_TYPE_MESH, GeometrySet::get_component_for_read(), blender::fn::FieldEvaluator::get_evaluated(), blender::fn::FieldEvaluator::get_evaluated_selection_as_mask(), MeshComponent::get_for_read(), GeometrySet::has_mesh(), blender::IndexMask::index_range(), GeometrySet::keep_only_during_modify(), MPoly::loopstart, max, Mesh::medge, mesh, blender::bke::mesh_attributes(), blender::bke::mesh_attributes_for_write(), Mesh::mloop, Mesh::mpoly, Mesh::mvert, blender::nodes::node_geo_extrude_mesh_cc::new_poly(), range_for_offsets_index(), GeometrySet::remove_geometry_during_modify(), GeometrySet::replace_mesh(), blender::fn::FieldEvaluator::set_selection(), blender::IndexMask::size(), blender::IndexRange::size(), blender::Span< T >::size(), blender::MutableSpan< T >::size(), Mesh::totedge, Mesh::totloop, MPoly::totloop, Mesh::totpoly, Mesh::totvert, MLoop::v, and verts.
Referenced by node_geo_exec().
|
static |
Definition at line 1045 of file node_geo_duplicate_elements.cc.
References accumulate_counts_to_offsets(), InstancesComponent::add_reference(), ATTR_DOMAIN_INSTANCE, InstancesComponent::attributes(), InstancesComponent::attributes_for_write(), GeometrySet::clear(), copy_attributes_without_id(), create_duplicate_index_attribute(), blender::nodes::node_geo_duplicate_elements_cc::IndexAttributes::duplicate_index, GEO_COMPONENT_TYPE_INSTANCES, GeometrySet::get_component_for_read(), GeometrySet::get_component_for_write(), GeometrySet::has_instances(), blender::IndexMask::index_range(), InstancesComponent::instance_reference_handles(), InstancesComponent::instance_transforms(), InstancesComponent::instances_num(), range_for_offsets_index(), InstancesComponent::references(), InstancesComponent::resize(), blender::IndexRange::size(), blender::Span< T >::slice(), and transform().
Referenced by node_geo_exec().
|
static |
Definition at line 1007 of file node_geo_duplicate_elements.cc.
References blender::Vector< T, InlineBufferCapacity, Allocator >::append(), duplicate_points_curve(), duplicate_points_mesh(), duplicate_points_pointcloud(), GeometrySet::gather_component_types(), GEO_COMPONENT_TYPE_CURVE, GEO_COMPONENT_TYPE_INSTANCES, GEO_COMPONENT_TYPE_MESH, GEO_COMPONENT_TYPE_POINT_CLOUD, GeometrySet::has_curves(), GeometrySet::has_mesh(), GeometrySet::has_pointcloud(), and GeometrySet::keep_only_during_modify().
Referenced by node_geo_exec().
|
static |
Definition at line 803 of file node_geo_duplicate_elements.cc.
References accumulate_counts_to_offsets(), ATTR_DOMAIN_POINT, blender::bke::CurvesGeometry::curves_range(), GeometrySet::get_component_for_read(), CurveComponent::get_for_read(), blender::Array< T, InlineBufferCapacity, Allocator >::last(), blender::threading::parallel_for(), blender::bke::CurvesGeometry::points_num(), and blender::bke::image::partial_update::wrap().
Referenced by duplicate_points().
|
static |
Definition at line 907 of file node_geo_duplicate_elements.cc.
References accumulate_counts_to_offsets(), blender::Array< T, InlineBufferCapacity, Allocator >::as_span(), ATTR_DOMAIN_POINT, BKE_mesh_new_nomain(), copy_attributes_without_id(), copy_stable_id_point(), create_duplicate_index_attribute(), blender::nodes::node_geo_duplicate_elements_cc::IndexAttributes::duplicate_index, GEO_COMPONENT_TYPE_MESH, GeometrySet::get_component_for_read(), GeometrySet::get_mesh_for_read(), blender::Array< T, InlineBufferCapacity, Allocator >::last(), mesh, blender::bke::mesh_attributes(), blender::bke::mesh_attributes_for_write(), Mesh::mvert, GeometrySet::replace_mesh(), blender::Span< T >::size(), threaded_slice_fill(), and Mesh::totvert.
Referenced by duplicate_points().
|
static |
Definition at line 959 of file node_geo_duplicate_elements.cc.
References accumulate_counts_to_offsets(), blender::fn::FieldEvaluator::add(), ATTR_DOMAIN_POINT, GeometryComponent::attribute_domain_size(), PointCloudComponent::attributes(), BKE_pointcloud_new_nomain(), copy_attributes_without_id(), copy_stable_id_point(), create_duplicate_index_attribute(), blender::nodes::node_geo_duplicate_elements_cc::IndexAttributes::duplicate_index, GEO_COMPONENT_TYPE_POINT_CLOUD, GeometrySet::get_component_for_read(), blender::Array< T, InlineBufferCapacity, Allocator >::last(), blender::bke::pointcloud_attributes_for_write(), and GeometrySet::replace_pointcloud().
Referenced by duplicate_points().
|
static |
Definition at line 63 of file node_geo_duplicate_elements.cc.
References GeometrySet::gather_attributes_for_propagation(), and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::remove().
Referenced by copy_attributes_without_id(), copy_curve_attributes_without_id(), copy_edge_attributes_without_id(), and copy_face_attributes_without_id().
|
static |
Definition at line 26 of file node_geo_duplicate_elements.cc.
References usdtokens::b(), blender::nodes::SocketDeclaration::description(), min, and N_.
Referenced by register_node_type_geo_duplicate_elements().
|
static |
Definition at line 1113 of file node_geo_duplicate_elements.cc.
References ATTR_DOMAIN_CURVE, ATTR_DOMAIN_EDGE, ATTR_DOMAIN_FACE, ATTR_DOMAIN_INSTANCE, ATTR_DOMAIN_POINT, BLI_assert_unreachable, duplicate_curves(), duplicate_edges(), duplicate_faces(), duplicate_instances(), duplicate_points(), GeometrySet::is_empty(), GeometrySet::modify_geometry_sets(), and params.
Referenced by register_node_type_geo_duplicate_elements().
|
static |
Definition at line 43 of file node_geo_duplicate_elements.cc.
References ATTR_DOMAIN_POINT, data, and node.
|
static |
Definition at line 50 of file node_geo_duplicate_elements.cc.
References ptr, and uiItemR().
Referenced by register_node_type_geo_duplicate_elements().
blender::nodes::node_geo_duplicate_elements_cc::NODE_STORAGE_FUNCS | ( | NodeGeometryDuplicateElements | ) |
|
static |
Definition at line 73 of file node_geo_duplicate_elements.cc.
Referenced by copy_stable_id_faces(), create_duplicate_index_attribute(), duplicate_faces(), and duplicate_instances().
|
static |
Definition at line 124 of file node_geo_duplicate_elements.cc.
References BLI_assert, blender::Span< T >::last(), blender::threading::parallel_for(), blender::Span< T >::size(), and blender::MutableSpan< T >::size().
Referenced by copy_stable_id_point().
|
static |
Definition at line 108 of file node_geo_duplicate_elements.cc.
References blender::Span< T >::index_range(), and blender::threading::parallel_for().
|
static |
Definition at line 93 of file node_geo_duplicate_elements.cc.
References BLI_assert, blender::Span< T >::last(), blender::threading::parallel_for(), blender::IndexMask::size(), blender::Span< T >::size(), and blender::MutableSpan< T >::size().
Referenced by duplicate_points_mesh().