15 template<
typename Component>
36 meta_data_final->data_type = blender::bke::attribute_data_type_highest_complexity(
37 {meta_data_final->data_type, meta_data.data_type});
39 {meta_data_final->domain, meta_data.domain});
64 attribute_id, domain, data_type,
nullptr);
67 const void *src_buffer = src_span.data();
68 void *dst_buffer = dst_span[
offset];
87 result.attributes_for_write()->lookup_or_add_for_write_only_span(
89 if (!write_attribute) {
102 int tot_instances = 0;
106 dst_component.
reserve(tot_instances);
111 for (
const int src_handle : src_references.
index_range()) {
112 handle_map[src_handle] = dst_component.
add_reference(src_references[src_handle]);
115 Span<float4x4> src_transforms = src_component->instance_transforms();
116 Span<int> src_reference_handles = src_component->instance_reference_handles();
119 const int src_handle = src_reference_handles[i];
120 const int dst_handle = handle_map[src_handle];
136 template<
typename Component>
140 for (
const GeometrySet &geometry_set : src_geometry_sets) {
141 const Component *
component = geometry_set.get_component_for_read<Component>();
147 if (components.
size() == 0) {
150 if (components.
size() == 1) {
151 result.add(*components[0]);
159 if constexpr (is_same_any_v<Component, InstancesComponent, VolumeComponent>) {
163 for (
const Component *
component : components) {
171 options.keep_original_ids =
true;
172 options.realize_instance_attributes =
false;
183 join_component_type<MeshComponent>(geometry_sets, geometry_set_result);
184 join_component_type<PointCloudComponent>(geometry_sets, geometry_set_result);
185 join_component_type<InstancesComponent>(geometry_sets, geometry_set_result);
186 join_component_type<VolumeComponent>(geometry_sets, geometry_set_result);
187 join_component_type<CurveComponent>(geometry_sets, geometry_set_result);
188 join_component_type<GeometryComponentEditData>(geometry_sets, geometry_set_result);
190 params.set_output(
"Geometry", std::move(geometry_set_result));
#define NODE_CLASS_GEOMETRY
void nodeRegisterType(struct bNodeType *ntype)
#define GEO_NODE_JOIN_GEOMETRY
static uint8 component(Color32 c, uint i)
SIMD_FORCE_INLINE btVector3 transform(const btVector3 &point) const
int add_reference(const InstanceReference &reference)
void add_instance(int instance_handle, const blender::float4x4 &transform)
int instances_num() const
void reserve(int min_capacity)
void copy_assign_n(const void *src, void *dst, int64_t n) const
ItemIterator items() const
auto add_or_modify(const Key &key, const CreateValueF &create_value, const ModifyValueF &modify_value) -> decltype(create_value(nullptr))
constexpr int64_t size() const
constexpr IndexRange index_range() const
constexpr bool contains(const T &value) const
void append(const T &value)
CCL_NAMESPACE_BEGIN struct Options options
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
static int domain_num(const CurvesGeometry &curves, const eAttrDomain domain)
const blender::CPPType * custom_data_type_to_cpp_type(const eCustomDataType type)
eAttrDomain attribute_domain_highest_priority(Span< eAttrDomain > domains)
GeometrySet realize_instances(GeometrySet geometry_set, const RealizeInstancesOptions &options)
static void node_geo_exec(GeoNodeExecParams params)
static void fill_new_attribute(Span< const GeometryComponent * > src_components, const AttributeIDRef &attribute_id, const eCustomDataType data_type, const eAttrDomain domain, GMutableSpan dst_span)
static void join_attributes(Span< const GeometryComponent * > src_components, GeometryComponent &result, Span< StringRef > ignored_attributes={})
static void join_component_type(Span< GeometrySet > src_geometry_sets, GeometrySet &result)
static void join_components(Span< const VolumeComponent * > src_components, GeometrySet &result)
static void node_declare(NodeDeclarationBuilder &b)
static Array< const GeometryComponent * > to_base_components(Span< const Component * > components)
static Map< AttributeIDRef, AttributeMetaData > get_final_attribute_info(Span< const GeometryComponent * > components, Span< StringRef > ignored_attributes)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
void register_node_type_geo_join_geometry()
void geo_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
GeometryComponent & get_component_for_write(GeometryComponentType component_type)
void add(const GeometryComponent &component)
NodeGeometryExecFunction geometry_node_execute
NodeDeclareFunction declare