forked from blender/blender
davidhaver-WIP-realize-depth #2
@ -12,7 +12,7 @@ namespace blender::geometry {
|
|||||||
bke::GeometrySet join_geometries(Span<bke::GeometrySet> geometries,
|
bke::GeometrySet join_geometries(Span<bke::GeometrySet> geometries,
|
||||||
const bke::AnonymousAttributePropagationInfo &propagation_info);
|
const bke::AnonymousAttributePropagationInfo &propagation_info);
|
||||||
|
|
||||||
void join_attributes(const Span<const bke::GeometryComponent *> src_components,
|
void join_attributes(Span<const bke::GeometryComponent *> src_components,
|
||||||
bke::GeometryComponent &result,
|
bke::GeometryComponent &r_result,
|
||||||
const Span<StringRef> ignored_attributes);
|
Span<StringRef> ignored_attributes = {});
|
||||||
} // namespace blender::geometry
|
} // namespace blender::geometry
|
||||||
|
@ -74,8 +74,8 @@ static void fill_new_attribute(const Span<const GeometryComponent *> src_compone
|
|||||||
}
|
}
|
||||||
aryeramaty marked this conversation as resolved
|
|||||||
|
|
||||||
void join_attributes(const Span<const GeometryComponent *> src_components,
|
void join_attributes(const Span<const GeometryComponent *> src_components,
|
||||||
GeometryComponent &result,
|
GeometryComponent &r_result,
|
||||||
const Span<StringRef> ignored_attributes = {})
|
const Span<StringRef> ignored_attributes)
|
||||||
{
|
{
|
||||||
const Map<AttributeIDRef, AttributeMetaData> info = get_final_attribute_info(src_components,
|
const Map<AttributeIDRef, AttributeMetaData> info = get_final_attribute_info(src_components,
|
||||||
ignored_attributes);
|
ignored_attributes);
|
||||||
@ -85,7 +85,7 @@ void join_attributes(const Span<const GeometryComponent *> src_components,
|
|||||||
const AttributeMetaData &meta_data = item.value;
|
const AttributeMetaData &meta_data = item.value;
|
||||||
|
|
||||||
bke::GSpanAttributeWriter write_attribute =
|
bke::GSpanAttributeWriter write_attribute =
|
||||||
result.attributes_for_write()->lookup_or_add_for_write_only_span(
|
r_result.attributes_for_write()->lookup_or_add_for_write_only_span(
|
||||||
attribute_id, meta_data.domain, meta_data.data_type);
|
attribute_id, meta_data.domain, meta_data.data_type);
|
||||||
if (!write_attribute) {
|
if (!write_attribute) {
|
||||||
continue;
|
continue;
|
||||||
@ -97,7 +97,7 @@ void join_attributes(const Span<const GeometryComponent *> src_components,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void join_instances(const Span<const GeometryComponent *> src_components,
|
static void join_instances(const Span<const GeometryComponent *> src_components,
|
||||||
GeometrySet &result)
|
GeometrySet &r_result)
|
||||||
{
|
{
|
||||||
Array<int> offsets_data(src_components.size() + 1);
|
Array<int> offsets_data(src_components.size() + 1);
|
||||||
for (const int i : src_components.index_range()) {
|
for (const int i : src_components.index_range()) {
|
||||||
@ -127,8 +127,8 @@ static void join_instances(const Span<const GeometryComponent *> src_components,
|
|||||||
array_utils::gather(handle_map.as_span(), src_handles, all_handles.slice(dst_range));
|
array_utils::gather(handle_map.as_span(), src_handles, all_handles.slice(dst_range));
|
||||||
}
|
}
|
||||||
|
|
||||||
result.replace_instances(dst_instances.release());
|
r_result.replace_instances(dst_instances.release());
|
||||||
auto &dst_component = result.get_component_for_write<bke::InstancesComponent>();
|
auto &dst_component = r_result.get_component_for_write<bke::InstancesComponent>();
|
||||||
join_attributes(src_components, dst_component, {".reference_index"});
|
join_attributes(src_components, dst_component, {".reference_index"});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ static void join_volumes(const Span<const GeometryComponent *> /*src_components*
|
|||||||
static void join_component_type(const bke::GeometryComponent::Type component_type,
|
static void join_component_type(const bke::GeometryComponent::Type component_type,
|
||||||
const Span<GeometrySet> src_geometry_sets,
|
const Span<GeometrySet> src_geometry_sets,
|
||||||
const bke::AnonymousAttributePropagationInfo &propagation_info,
|
const bke::AnonymousAttributePropagationInfo &propagation_info,
|
||||||
GeometrySet &result)
|
GeometrySet &r_result)
|
||||||
{
|
{
|
||||||
Vector<const GeometryComponent *> components;
|
Vector<const GeometryComponent *> components;
|
||||||
for (const GeometrySet &geometry_set : src_geometry_sets) {
|
for (const GeometrySet &geometry_set : src_geometry_sets) {
|
||||||
@ -156,16 +156,16 @@ static void join_component_type(const bke::GeometryComponent::Type component_typ
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (components.size() == 1) {
|
if (components.size() == 1) {
|
||||||
result.add(*components.first());
|
r_result.add(*components.first());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (component_type) {
|
switch (component_type) {
|
||||||
case bke::GeometryComponent::Type::Instance:
|
case bke::GeometryComponent::Type::Instance:
|
||||||
join_instances(components, result);
|
join_instances(components, r_result);
|
||||||
return;
|
return;
|
||||||
case bke::GeometryComponent::Type::Volume:
|
case bke::GeometryComponent::Type::Volume:
|
||||||
join_volumes(components, result);
|
join_volumes(components, r_result);
|
||||||
return;
|
return;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -191,7 +191,7 @@ static void join_component_type(const bke::GeometryComponent::Type component_typ
|
|||||||
VArray<bool>::ForSingle(true, instances.get()->instances_num()), memory);
|
VArray<bool>::ForSingle(true, instances.get()->instances_num()), memory);
|
||||||
GeometrySet joined_components = realize_instances(
|
GeometrySet joined_components = realize_instances(
|
||||||
GeometrySet::from_instances(instances.release()), options);
|
GeometrySet::from_instances(instances.release()), options);
|
||||||
result.add(joined_components.get_component_for_write(component_type));
|
r_result.add(joined_components.get_component_for_write(component_type));
|
||||||
}
|
}
|
||||||
|
|
||||||
GeometrySet join_geometries(const Span<GeometrySet> geometries,
|
GeometrySet join_geometries(const Span<GeometrySet> geometries,
|
||||||
|
Loading…
Reference in New Issue
Block a user
I would rather not make clean-up or style changes to files I didn't modify in the PR. It just makes it a little bit harder to see what has changed.
the changes were done because you moved the declaration to the .hh file so it needed to follow the convention of public functions
OK