60 const Mesh *
mesh = mesh_component->get_for_read();
71 const Mesh *first_input_mesh = src_components[0]->get_for_read();
85 const Mesh *
mesh = mesh_component->get_for_read();
86 if (
mesh ==
nullptr) {
92 MVert &new_vert = new_mesh->
mvert[vert_offset + i];
98 MEdge &new_edge = new_mesh->
medge[edge_offset + i];
100 new_edge.
v1 += vert_offset;
101 new_edge.
v2 += vert_offset;
105 MLoop &new_loop = new_mesh->
mloop[loop_offset + i];
107 new_loop.
v += vert_offset;
108 new_loop.
e += edge_offset;
112 MPoly &new_poly = new_mesh->
mpoly[poly_offset + i];
126 template<
typename Component>
137 for (
const std::string &name :
names) {
138 attribute_names.
add(name);
141 return attribute_names;
154 data_types.
append(attribute->custom_data_type());
155 domains.
append(attribute->domain());
174 const int domain_size =
component->attribute_domain_size(domain);
175 if (domain_size == 0) {
179 attribute_name, domain, data_type,
nullptr);
181 fn::GSpan src_span = read_attribute->get_span();
182 const void *src_buffer = src_span.
data();
183 void *dst_buffer = dst_span[offset];
186 offset += domain_size;
195 for (
StringRef name : ignored_attributes) {
196 attribute_names.
remove(name);
199 for (
const std::string &attribute_name : attribute_names) {
205 attribute_name, domain, data_type);
206 if (!write_attribute ||
208 write_attribute->
domain() != domain) {
222 dst_component.
replace(new_mesh);
227 {
"position",
"material_index",
"normal",
"shade_smooth",
"crease"});
239 dst_component.
replace(pointcloud);
253 dst_component.
add_instance(instanced_data[i], transforms[i], ids[i]);
266 template<
typename Component>
270 for (
const GeometrySet &geometry_set : src_geometry_sets) {
271 const Component *
component = geometry_set.get_component_for_read<Component>();
277 if (components.
size() == 0) {
280 if (components.
size() == 1) {
281 result.add(*components[0]);
292 join_component_type<MeshComponent>(geometry_sets, geometry_set_result);
293 join_component_type<PointCloudComponent>(geometry_sets, geometry_set_result);
294 join_component_type<InstancesComponent>(geometry_sets, geometry_set_result);
295 join_component_type<VolumeComponent>(geometry_sets, geometry_set_result);
297 params.set_output(
"Geometry", std::move(geometry_set_result));
struct Mesh * BKE_mesh_new_nomain(int verts_len, int edges_len, int tessface_len, int loops_len, int polys_len)
void BKE_mesh_copy_settings(struct Mesh *me_dst, const struct Mesh *me_src)
void node_type_socket_templates(struct bNodeType *ntype, struct bNodeSocketTemplate *inputs, struct bNodeSocketTemplate *outputs)
#define NODE_CLASS_GEOMETRY
void nodeRegisterType(struct bNodeType *ntype)
#define GEO_NODE_JOIN_GEOMETRY
General operations for point-clouds.
struct PointCloud * BKE_pointcloud_new_nomain(const int totpoint)
static uint8 component(Color32 c, uint i)
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
void add_instance(Object *object, blender::float4x4 transform, const int id=-1)
void replace(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
void apply_span_and_save()
void replace(PointCloud *pointcloud, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
bool remove(const Key &key)
void append(const T &value)
AttributeDomain domain() const
fn::GMutableSpan get_span_for_write_only()
const CPPType & cpp_type() const
void copy_to_initialized_n(const void *src, void *dst, int64_t n) const
const void * data() const
AttributeDomain attribute_domain_highest_priority(Span< AttributeDomain > domains)
const CPPType * custom_data_type_to_cpp_type(const CustomDataType type)
std::unique_ptr< ReadAttribute > ReadAttributePtr
CustomDataType attribute_data_type_highest_complexity(Span< CustomDataType > data_types)
static void join_component_type(Span< GeometrySet > src_geometry_sets, GeometrySet &result)
static Set< std::string > find_all_attribute_names(Span< const GeometryComponent * > components)
static void geo_node_join_geometry_exec(GeoNodeExecParams params)
static void fill_new_attribute(Span< const GeometryComponent * > src_components, StringRef attribute_name, const CustomDataType data_type, const AttributeDomain domain, fn::GMutableSpan dst_span)
static void determine_final_data_type_and_domain(Span< const GeometryComponent * > components, StringRef attribute_name, CustomDataType *r_type, AttributeDomain *r_domain)
static Mesh * join_mesh_topology_and_builtin_attributes(Span< const MeshComponent * > src_components)
static Array< const GeometryComponent * > to_base_components(Span< const Component * > components)
static void join_attributes(Span< const GeometryComponent * > src_components, GeometryComponent &result, Span< StringRef > ignored_attributes={})
static void join_components(Span< const MeshComponent * > src_components, GeometrySet &result)
static bNodeSocketTemplate geo_node_join_geometry_out[]
void register_node_type_geo_join_geometry()
static bNodeSocketTemplate geo_node_join_geometry_in[]
void geo_node_type_base(bNodeType *ntype, int type, const char *name, short nclass, short flag)
Compact definition of a node socket.
NodeGeometryExecFunction geometry_node_execute