42using bke::AttributeDomainAndType;
43using bke::GSpanAttributeWriter;
44using bke::InstanceReference;
46using bke::SpanAttributeWriter;
58 return this->kinds.
size();
379 instances(gather_info.instances_attriubutes.size())
418 src.materialize_compressed_to_uninitialized(range, dst.slice(range).data());
426 value.type()->fill_construct_n(value.get(), dst.slice(range).data(), range.size());
431 const Span<std::optional<GVArray>> src_attributes,
439 for (const int attribute_index : attribute_range) {
440 const bke::AttrDomain domain = ordered_attributes.kinds[attribute_index].domain;
441 const IndexRange element_slice = range_fn(domain);
443 GSpanAttributeWriter &writer = dst_attribute_writers[attribute_index];
447 GMutableSpan dst_span = writer.span.slice(element_slice);
448 if (src_attributes[attribute_index].has_value()) {
449 threaded_copy(*src_attributes[attribute_index], dst_span);
452 const CPPType &cpp_type = dst_span.type();
453 const void *fallback = attribute_fallbacks.array[attribute_index] == nullptr ?
454 cpp_type.default_value() :
455 attribute_fallbacks.array[attribute_index];
456 threaded_fill({cpp_type, fallback}, dst_span);
467 if (
options.keep_original_ids) {
478 for (const int i : range) {
479 dst_ids[i] = noise::hash(task_id, i);
485 for (const int i : range) {
486 dst_ids[i] = noise::hash(task_id, stored_ids[i]);
507 for (
const int fill_id : fill_ids_span) {
509 index_by_fill_ids.
add(fill_id);
512 return index_by_fill_ids;
516 const int fill_id = fill_ids[i];
518 index_by_fill_ids.
add(fill_id);
521 return index_by_fill_ids;
533 const int attr_index,
537 const auto get_single_value = [&](
const int task_index) ->
GPointer {
538 const TaskAttrInfo task_info = get_task_attributes(task_index);
539 if (task_info.
attributes[attr_index].has_value()) {
552 const GPointer first_value = get_single_value(0);
564 for (
const int i : range) {
565 const GPointer value = get_single_value(i);
575 std::logical_and<bool>());
589static void gather_realize_tasks_recursive(GatherTasksInfo &gather_info,
590 const int current_depth,
591 const int target_depth,
594 const InstanceContext &base_instance_context);
598 std::variant<GSpan, GPointer>
data;
614 const int attribute_index = ordered_attributes.
names.index_of_try(iter.
name);
615 if (attribute_index == -1) {
623 const bke::AttrType expected_type = ordered_attributes.
kinds[attribute_index].data_type;
629 attribute.varray.get_internal_single(ptr);
641 attributes_to_override.
append({attribute_index,
GPointer(expected_cpp_type, ptr)});
657 span = temporary_array;
659 attributes_to_override.
append({attribute_index, span});
662 return attributes_to_override;
678 fn(geometry_set, base_transform,
id);
682 const int current_depth,
683 const int target_depth,
713 const bool is_top_level = current_depth == 0;
719 const int child_target_depth = is_top_level ? gather_info.
depths[i] : target_depth;
720 const int handle = handles[i];
729 if (
const auto *
array = std::get_if<GSpan>(&attr.data)) {
730 ptrs[attr.attr_index] = (*array)[i];
732 else if (
const auto *single = std::get_if<GPointer>(&attr.data)) {
733 ptrs[attr.attr_index] = single->get();
737 set_fallbacks(pointcloud_attributes_to_override, instance_context.
pointclouds.
array);
738 set_fallbacks(mesh_attributes_to_override, instance_context.
meshes.
array);
739 set_fallbacks(curve_attributes_to_override, instance_context.
curves.
array);
740 set_fallbacks(grease_pencil_attributes_to_override, instance_context.
grease_pencils.
array);
741 set_fallbacks(instance_attributes_to_override, instance_context.
instances.
array);
745 if (stored_instance_ids.
is_empty()) {
749 local_instance_id =
uint32_t(stored_instance_ids[i]);
761 instance_context.
id =
id;
765 instance_geometry_set,
776 const int current_depth,
777 const int target_depth,
790 if (
mesh !=
nullptr &&
mesh->verts_num > 0) {
799 base_instance_context.
meshes,
800 base_instance_context.
id});
811 const PointCloud *pointcloud = pointcloud_component.get();
812 if (pointcloud !=
nullptr) {
813 const int pointcloud_index = gather_info.
pointclouds.
order.index_of(pointcloud);
821 base_instance_context.
id});
829 if (
curves !=
nullptr &&
curves->geometry.curve_num > 0) {
839 base_instance_context.
curves,
840 base_instance_context.
id});
866 if (current_depth == target_depth) {
874 if (instances !=
nullptr && instances->
instances_num() > 0) {
880 base_instance_context);
898 if (edit_component->gizmo_edit_hints_ || edit_component->curves_edit_hints_) {
911 const int current_depth,
912 const std::optional<int> max_depth,
916 if (r_components.
add_as(component)) {
917 component->add_user();
920 if (current_depth == max_depth) {
924 if (!instances_component) {
931 if (
options.realize_instance_attributes) {
932 if (r_components.
add_as(instances_component)) {
933 instances_component->add_user();
940 reference_geometry, component_type,
options, current_depth + 1, max_depth, r_components);
952 if (r_components.
add_as(component)) {
953 component->add_user();
957 if (!instances_component) {
967 const int references_num = references.
size();
971 const int reference_i = handles[instance_i];
972 const int instance_depth = varied_depth_option.
depths[instance_i];
973 std::optional<int> &max_depth = max_reference_depth[reference_i];
974 if (!max_depth.has_value()) {
982 max_depth = std::max<int>(*max_depth, instance_depth);
985 bool is_anything_realized =
false;
986 for (
const int reference_i :
IndexRange(references_num)) {
987 const std::optional<int> max_depth = max_reference_depth[reference_i];
988 if (max_depth == 0) {
995 reference_geometry, component_type,
options, 1, max_depth, r_components);
996 is_anything_realized =
true;
999 if (is_anything_realized) {
1000 if (
options.realize_instance_attributes) {
1001 if (r_components.
add_as(instances_component)) {
1002 instances_component->add_user();
1018 const int top_level_instances_num = top_level_instances_component ?
1020 AttrDomain::Instance) :
1026 varied_depth_option.
selection.
size() == top_level_instances_num)
1050 if (
ELEM(iter.
name,
"instance_transform",
".reference_index")) {
1066 dst_domain == AttrDomain::Instance)
1070 dst_domain = AttrDomain::Layer;
1073 !
options.realize_to_point_domain)
1076 dst_domain = AttrDomain::Curve;
1080 dst_domain = AttrDomain::Point;
1087 return attributes_to_propagate;
1105 for (
const int i : attributes_to_propagate.
names.index_range()) {
1106 if (attributes_to_propagate.
names[i] ==
"id") {
1109 ordered_attributes.
names.add_new(attributes_to_propagate.
names[i]);
1110 ordered_attributes.
kinds.append(attributes_to_propagate.
kinds[i]);
1112 return ordered_attributes;
1123 src_components.
size() == attribute_fallback.
size());
1130 for (
const int component_index : src_components.
index_range()) {
1132 *src_components[component_index]);
1137 auto dst_instances = std::make_unique<bke::Instances>(offsets.
total_size());
1141 MutableSpan<int> all_handles = dst_instances->reference_handles_for_write();
1143 for (
const int component_index : src_components.
index_range()) {
1145 *src_components[component_index]);
1147 const float4x4 &src_base_transform = src_base_transforms[component_index];
1151 for (
const int src_handle : src_references.
index_range()) {
1152 handle_map[src_handle] = dst_instances->add_reference(src_references[src_handle]);
1154 const IndexRange dst_range = offsets[component_index];
1166 for (
const int component_index : src_components.
index_range()) {
1168 *src_components[component_index]);
1170 attributes_by_component[component_index].
reinitialize(all_instances_attributes.
size());
1171 for (
const int attr_index : all_instances_attributes.
index_range()) {
1173 all_instances_attributes.
names[attr_index],
1174 all_instances_attributes.
kinds[attr_index].domain,
1175 all_instances_attributes.
kinds[attr_index].data_type))
1177 attributes_by_component[component_index][attr_index] = attr;
1182 for (
const int attribute_index : all_instances_attributes.
index_range()) {
1183 const StringRef name = all_instances_attributes.
names[attribute_index];
1184 const bke::AttrType type = all_instances_attributes.
kinds[attribute_index].data_type;
1185 if (
ELEM(name,
"instance_transform",
".reference_index")) {
1190 src_components.
size(),
1191 all_instances_attributes,
1193 return {.attributes = attributes_by_component[task_index],
1194 .fallbacks = attribute_fallback[task_index]};
1206 for (
const int component_index : src_components.
index_range()) {
1209 const IndexRange dst_range = offsets[component_index];
1211 if (src_attributes[attribute_index].has_value()) {
1215 const void *fallback = fallbacks[attribute_index] ? fallbacks[attribute_index] :
1220 write_attribute.
finish();
1224 r_realized_geometry.replace_instances(dst_instances.release());
1237 bool &r_create_radii,
1243 for (
const int i : attributes_to_propagate.
names.index_range()) {
1244 if (attributes_to_propagate.
names[i] ==
"position") {
1247 if (attributes_to_propagate.
names[i] ==
"id") {
1251 if (attributes_to_propagate.
names[i] ==
"radius") {
1252 r_create_radii =
true;
1255 ordered_attributes.
names.add_new(attributes_to_propagate.
names[i]);
1256 ordered_attributes.
kinds.append(attributes_to_propagate.
kinds[i]);
1258 return ordered_attributes;
1265 r_pointclouds.
add(pointcloud);
1268 instances->foreach_referenced_geometry([&](
const bke::GeometrySet &instance_geometry_set) {
1282 varied_depth_option,
1288 for (
const int pointcloud_index : info.
realize_info.index_range()) {
1354 BLI_assert(domain == bke::AttrDomain::Point);
1355 UNUSED_VARS_NDEBUG(domain);
1358 dst_attribute_writers);
1366 for (
const int attribute_index : ordered_attributes.
index_range()) {
1367 const void *value = attribute_fallbacks.
array[attribute_index];
1374 attributes.
add(ordered_attributes.
names[attribute_index],
1393 if (tasks.
size() == 1) {
1398 new_points->tag_positions_changed();
1408 r_result.
errors.append(
RPT_(
"Realized point cloud has too many points."));
1419 dst_pointcloud->
mat = MEM_dupalloc(first_pointcloud.
mat);
1439 for (
const int attribute_index : ordered_attributes.
index_range()) {
1440 const StringRef name = ordered_attributes.
names[attribute_index];
1446 return {.attributes = tasks[task_index].pointcloud_info->attributes,
1447 .fallbacks = tasks[task_index].attribute_fallbacks};
1452 dst_attribute_writers.
append({});
1455 dst_attribute_writers.
append(
1461 for (const int task_index : task_range) {
1462 const RealizePointCloudTask &task = tasks[task_index];
1463 execute_realize_pointcloud_task(options,
1466 dst_attribute_writers,
1475 dst_attribute.finish();
1478 point_radii.finish();
1493 bool &r_create_material_index)
1498 for (
const int i : attributes_to_propagate.
names.index_range()) {
1499 if (
ELEM(attributes_to_propagate.
names[i],
1508 if (attributes_to_propagate.
names[i] ==
"id") {
1512 if (attributes_to_propagate.
names[i] ==
"material_index") {
1513 r_create_material_index =
true;
1516 ordered_attributes.
names.add_new(attributes_to_propagate.
names[i]);
1517 ordered_attributes.
kinds.append(attributes_to_propagate.
kinds[i]);
1519 return ordered_attributes;
1526 if (
mesh->verts_num > 0) {
1531 instances->foreach_referenced_geometry([&](
const bke::GeometrySet &instance_geometry_set) {
1546 varied_depth_option,
1552 if (
mesh->totcol == 0) {
1570 for (
const int mesh_index : info.
realize_info.index_range()) {
1582 if (
mesh->totcol == 0) {
1588 const int new_slot_index = info.
materials.index_of(material);
1661 return mesh->runtime->loose_edges_cache.is_cached() && mesh->loose_edges().is_empty();
1665 return mesh->runtime->loose_verts_cache.is_cached() && mesh->loose_verts().is_empty();
1669 return mesh->no_overlapping_topology();
1713 for (const int i : edge_range) {
1714 dst_edges[i] = src_edges[i] + task.start_indices.vert;
1718 src_corner_verts.index_range(), 1024, [&](
const IndexRange corner_range) {
1719 for (const int i : corner_range) {
1720 dst_corner_verts[i] = src_corner_verts[i] + task.start_indices.vert;
1723 threading::parallel_for(
1724 src_corner_edges.index_range(), 1024, [&](
const IndexRange corner_range) {
1725 for (const int i : corner_range) {
1726 dst_corner_edges[i] = src_corner_edges[i] + task.start_indices.edge;
1729 threading::parallel_for(src_faces.index_range(), 1024, [&](
const IndexRange face_range) {
1730 for (const int i : face_range) {
1731 dst_face_offsets[i] = src_faces[i].start() + task.start_indices.corner;
1735 if (!all_dst_vert_ids.is_empty()) {
1737 mesh_info.stored_vert_ids,
1739 all_dst_vert_ids.slice(task.start_indices.vert, mesh.verts_num));
1742 const auto domain_to_range = [&](
const bke::AttrDomain domain) {
1744 case bke::AttrDomain::Point:
1745 return dst_vert_range;
1746 case bke::AttrDomain::Edge:
1747 return dst_edge_range;
1748 case bke::AttrDomain::Face:
1749 return dst_face_range;
1750 case bke::AttrDomain::Corner:
1751 return dst_corner_range;
1754 return IndexRange();
1758 if (all_dst_custom_normals) {
1759 if (all_dst_custom_normals.span.type().is<
short2>()) {
1760 if (mesh_info.custom_normal.is_empty()) {
1761 all_dst_custom_normals.span.typed<
short2>().slice(dst_corner_range).fill(
short2(0));
1764 all_dst_custom_normals.span.typed<
short2>()
1765 .slice(dst_corner_range)
1766 .copy_from(mesh_info.custom_normal.typed<
short2>());
1770 const IndexRange dst_range = domain_to_range(all_dst_custom_normals.domain);
1771 math::transform_normals(mesh_info.custom_normal.typed<
float3>(),
1773 all_dst_custom_normals.span.typed<
float3>().slice(dst_range));
1778 task.attribute_fallbacks,
1781 dst_attribute_writers);
1784 if (!all_dst_origindex_vert.is_empty()) {
1785 const IndexRange dst_range(task.start_indices.vert, mesh.verts_num);
1786 if (
const int *src_data =
static_cast<const int *
>(
1789 all_dst_origindex_vert.slice(dst_range).copy_from(
Span<int>(src_data, mesh.verts_num));
1796 if (!all_dst_origindex_edge.is_empty()) {
1797 const IndexRange dst_range(task.start_indices.edge, mesh.edges_num);
1798 if (
const int *src_data =
static_cast<const int *
>(
1801 all_dst_origindex_edge.slice(dst_range).copy_from(
Span<int>(src_data, mesh.edges_num));
1808 if (!all_dst_origindex_face.is_empty()) {
1809 const IndexRange dst_range(task.start_indices.face, mesh.faces_num);
1810 if (
const int *src_data =
static_cast<const int *
>(
1813 all_dst_origindex_face.slice(dst_range).copy_from(
Span<int>(src_data, mesh.faces_num));
1826 const int attribute_index = ordered_attributes.
names.index_of_try(src_name);
1827 if (attribute_index == -1) {
1848 existing_names.
add(defgroup.
name);
1850 for (
const Mesh *
mesh : src_meshes) {
1852 if (!existing_names.
add(src.
name)) {
1875 int final_max = std::numeric_limits<int>::min();
1877 if (info.mesh->runtime->max_material_index.is_cached()) {
1878 if (
const std::optional<int>
max = info.mesh->runtime->max_material_index.data()) {
1883 if (
const std::optional<int> single = info.material_indices.get_if_single()) {
1887 return std::nullopt;
1895 const std::optional<int> first_opt = infos[0].material_indices.get_if_single();
1897 return std::nullopt;
1908 for (
const int i : range) {
1920 std::logical_and<bool>());
1922 return std::nullopt;
1931 if (all_meshes_info.
materials.size() <= 1) {
1944 dst_attributes.
add<
int>(
1953 for (const int task_i : range) {
1954 const RealizeMeshTask &task = tasks[task_i];
1955 const MeshRealizeInfo &mesh_info = *task.mesh_info;
1956 const Mesh &mesh = *mesh_info.mesh;
1957 const IndexRange dst_face_range(task.start_indices.face, mesh.faces_num);
1958 MutableSpan<int> dst_material_indices = dst_attr.span.slice(dst_face_range);
1959 if (mesh.totcol == 0) {
1961 dst_material_indices.fill(get_mapped_material_index(mesh_info, 0));
1964 if (const std::optional<int> src_index = mesh_info.material_indices.get_if_single()) {
1965 dst_material_indices.fill(get_mapped_material_index(mesh_info, *src_index));
1968 const VArraySpan<int> src_span(mesh_info.material_indices);
1969 const Span<int> map = mesh_info.material_index_map;
1970 const int src_mat_num = mesh.totcol;
1971 threading::parallel_for(src_span.index_range(), 1024, [&](const IndexRange face_range) {
1972 for (const int i : face_range) {
1973 const int src_index = src_span[i];
1974 const bool valid = IndexRange(src_mat_num).contains(src_index);
1975 dst_material_indices[i] = valid ? map[src_index] : 0;
1999 if (tasks.
size() == 1) {
2022 r_result.
errors.append(
RPT_(
"Realized mesh has too many elements."));
2033 int *
data =
static_cast<int *
>(
2039 int *
data =
static_cast<int *
>(
2045 int *
data =
static_cast<int *
>(
2063 *dst_mesh, ordered_attributes, all_meshes_info.
order.as_span().drop_front(1));
2068 Material *material = ordered_materials[i];
2098 for (
const int attribute_index : ordered_attributes.
index_range()) {
2099 const StringRef name = ordered_attributes.
names[attribute_index];
2106 return {.attributes = tasks[task_index].mesh_info->attributes,
2107 .fallbacks = tasks[task_index].attribute_fallbacks};
2112 dst_attribute_writers.
append({});
2115 dst_attribute_writers.
append(
2121 for (const int task_index : task_range) {
2122 const RealizeMeshTask &task = tasks[task_index];
2123 execute_realize_mesh_task(options,
2126 dst_attribute_writers,
2136 dst_origindex_face);
2140 join_mesh_material_indices(all_meshes_info, tasks, *dst_mesh);
2144 dst_attribute.finish();
2147 custom_normals.finish();
2149 if (
options.preserve_normals) {
2150 IndexMaskMemory memory;
2151 const IndexMask mirrored_tasks = IndexMask::from_predicate(
2152 tasks.index_range(),
2154 [&](
const int task_i) { return math::is_negative(tasks[task_i].transform); },
2155 exec_mode::grain_size(1024));
2156 if (!mirrored_tasks.is_empty()) {
2157 Array<IndexMask::Initializer> mirrored_face_ranges(mirrored_tasks.size());
2158 mirrored_tasks.foreach_index(
2159 [&](
const int task_i,
const int pos) {
2160 const RealizeMeshTask &task = tasks[task_i];
2161 mirrored_face_ranges[pos] = IndexRange(task.start_indices.face,
2162 task.mesh_info->mesh->faces_num);
2164 exec_mode::grain_size(1024));
2165 const IndexMask mirrored_faces = IndexMask::from_initializers(mirrored_face_ranges, memory);
2166 bke::mesh_flip_faces(*dst_mesh, mirrored_faces);
2170 bke::mesh_ensure_default_uv_map(*dst_mesh);
2172 if (all_meshes_info.no_loose_edges_hint) {
2173 dst_mesh->tag_loose_edges_none();
2175 if (all_meshes_info.no_loose_verts_hint) {
2176 dst_mesh->tag_loose_verts_none();
2178 if (all_meshes_info.no_overlapping_hint) {
2179 dst_mesh->tag_overlapping_none();
2194 bool &r_create_fill_id)
2199 for (
const int i : attributes_to_propagate.
names.index_range()) {
2200 if (
ELEM(attributes_to_propagate.
names[i],
2209 if (attributes_to_propagate.
names[i] ==
"id") {
2213 if (attributes_to_propagate.
names[i] ==
"fill_id") {
2214 r_create_fill_id =
true;
2217 ordered_attributes.
names.add_new(attributes_to_propagate.
names[i]);
2218 ordered_attributes.
kinds.append(attributes_to_propagate.
kinds[i]);
2220 return ordered_attributes;
2227 if (
curves->geometry.curve_num != 0) {
2232 instances->foreach_referenced_geometry([&](
const bke::GeometrySet &instance_geometry_set) {
2246 varied_depth_option,
2252 for (
const int curve_index : info.
realize_info.index_range()) {
2254 const Curves *curves_id = info.
order[curve_index];
2256 curve_info.
curves = curves_id;
2288 if (attributes.
contains(
"radius")) {
2292 if (attributes.
contains(
"handle_right")) {
2294 .varray.get_internal_span();
2296 .varray.get_internal_span();
2299 if (attributes.
contains(
"custom_normal")) {
2301 .varray.get_internal_span();
2311 if (all_curves_info.
order.is_empty()) {
2345 curves.nurbs_custom_knots_by_curve().total_size()};
2370 all_radii.
slice(dst_point_range).
fill(1.0f);
2384 all_custom_normals.
slice(dst_point_range));
2392 for (const int i : range) {
2393 dst_offsets[i] = task.start_indices.point + src_offsets[i];
2397 dst_curves.nurbs_custom_knots_for_write()
2398 .slice(dst_custom_knot_range)
2399 .copy_from(
curves.nurbs_custom_knots());
2401 if (!all_dst_ids.is_empty()) {
2403 options, curves_info.stored_ids, task.id, all_dst_ids.slice(dst_point_range));
2406 if (!all_dst_fill_ids.is_empty()) {
2407 MutableSpan<int> dst_fill_ids = all_dst_fill_ids.slice(dst_curve_range);
2408 const VArray<int> &src_fill_ids = curves_info.stored_fill_ids;
2409 const VectorSet<int> &index_by_fill_id = curves_info.index_by_fill_id;
2411 if (src_fill_ids.is_empty() || index_by_fill_id.is_empty()) {
2412 dst_fill_ids.fill(0);
2415 threading::parallel_for(
curves.curves_range(), 2048, [&](
const IndexRange range) {
2416 for (const int i : range) {
2417 const int src_fill_id = src_fill_ids[i];
2418 if (src_fill_id == 0) {
2419 dst_fill_ids[i] = 0;
2423 const int fill_id_index = index_by_fill_id.index_of(src_fill_id);
2425 dst_fill_ids[i] = task.start_indices.fill_id + fill_id_index + 1;
2433 curves_info.attributes,
2434 task.attribute_fallbacks,
2436 [&](
const bke::AttrDomain domain) {
2438 case bke::AttrDomain::Point:
2439 return IndexRange(task.start_indices.point, curves.points_num());
2440 case bke::AttrDomain::Curve:
2441 return IndexRange(task.start_indices.curve, curves.curves_num());
2443 BLI_assert_unreachable();
2444 return IndexRange();
2447 dst_attribute_writers);
2456 existing_names.
add(defgroup.
name);
2458 for (
const Curves *src_curve : src_curves) {
2459 for (
const bDeformGroup &src : src_curve->geometry.vertex_group_names) {
2460 if (!existing_names.
add(src.
name)) {
2481 if (tasks.
size() == 1) {
2485 new_curves->geometry.wrap().transform(task.
transform);
2489 new_curves->geometry.wrap().attributes_for_write());
2500 r_result.
errors.append(
RPT_(
"Realized curves data has too many elements."));
2507 if (custom_knot_num) {
2537 for (
const int attribute_index : ordered_attributes.
index_range()) {
2538 const StringRef name = ordered_attributes.
names[attribute_index];
2545 return {.attributes = tasks[task_index].curve_info->attributes,
2546 .fallbacks = tasks[task_index].attribute_fallbacks};
2551 dst_attribute_writers.
append({});
2554 dst_attribute_writers.
append(
2561 if (all_curves_info.create_handle_postion_attributes) {
2562 handle_left = dst_attributes.lookup_or_add_for_write_only_span<
float3>(
"handle_left",
2564 handle_right = dst_attributes.lookup_or_add_for_write_only_span<
float3>(
2569 if (all_curves_info.create_radius_attribute) {
2570 radius = dst_attributes.lookup_or_add_for_write_only_span<
float>(
"radius",
2571 bke::AttrDomain::Point);
2574 if (all_curves_info.create_custom_normal_attribute) {
2575 custom_normal = dst_attributes.lookup_or_add_for_write_only_span<
float3>(
2576 "custom_normal", bke::AttrDomain::Point);
2580 threading::parallel_for(tasks.index_range(), 100, [&](
const IndexRange task_range) {
2581 for (const int task_index : task_range) {
2582 const RealizeCurveTask &task = tasks[task_index];
2583 execute_realize_curve_task(options,
2588 dst_attribute_writers,
2594 custom_normal.span);
2599 dst_curves.runtime->type_counts.fill(0);
2600 for (
const RealizeCurveTask &task : tasks) {
2602 dst_curves.runtime->type_counts[i] +=
2603 task.curve_info->curves->geometry.runtime->type_counts[i];
2609 dst_attribute.finish();
2633 for (
const int i : attributes_to_propagate.
names.index_range()) {
2634 ordered_attributes.
names.add_new(attributes_to_propagate.
names[i]);
2635 ordered_attributes.
kinds.append(attributes_to_propagate.
kinds[i]);
2637 return ordered_attributes;
2649 instances->foreach_referenced_geometry([&](
const bke::GeometrySet &instance_geometry_set) {
2663 geometry_set,
options, varied_depth_options);
2667 for (
const int grease_pencil_index : info.
realize_info.index_range()) {
2706 for (
const int layer_i : src_layers.
index_range()) {
2711 dst_layer.set_name(src_layer.name());
2722 dst_curves = src_curves;
2728 for (
int &material_index : material_indices.
span) {
2729 if (material_index >= 0 && material_index < src_grease_pencil.material_array_num) {
2733 material_indices.
finish();
2741 BLI_assert(domain == bke::AttrDomain::Layer);
2742 UNUSED_VARS_NDEBUG(domain);
2743 return dst_layers_slice;
2745 dst_attribute_writers);
2768 if (tasks.
size() == 1) {
2782 r_result.
errors.append(
RPT_(
"Realized grease pencil has too many layers."));
2789 *dst_grease_pencil);
2793 dst_grease_pencil->add_layers_with_empty_drawings_for_eval(new_layers_num);
2796 if (!all_grease_pencils_info.
materials.is_empty()) {
2797 MEM_SAFE_DELETE(dst_grease_pencil->material_array);
2798 dst_grease_pencil->material_array_num = all_grease_pencils_info.
materials.size();
2800 dst_grease_pencil->material_array_num, __func__);
2802 dst_grease_pencil->material_array_num,
2803 dst_grease_pencil->material_array);
2809 for (
const int attribute_index : ordered_attributes.
index_range()) {
2810 const StringRef name = ordered_attributes.
names[attribute_index];
2816 return {.attributes = tasks[task_index].grease_pencil_info->attributes,
2817 .fallbacks = tasks[task_index].attribute_fallbacks};
2822 dst_attribute_writers.
append({});
2825 dst_attribute_writers.
append(
2831 for (const int task_index : task_range) {
2832 const RealizeGreasePencilTask &task = tasks[task_index];
2833 execute_realize_grease_pencil_task(
2834 task, ordered_attributes, *dst_grease_pencil, dst_attribute_writers);
2840 dst_attribute.finish();
2860 if (!component.curves_edit_hints_) {
2861 if (task.edit_data->curves_edit_hints_) {
2862 component.curves_edit_hints_ = std::make_unique<bke::CurvesEditHints>(
2863 *task.edit_data->curves_edit_hints_);
2866 if (
const bke::GizmoEditHints *src_gizmo_edit_hints = task.edit_data->gizmo_edit_hints_.get())
2868 if (!component.gizmo_edit_hints_) {
2869 component.gizmo_edit_hints_ = std::make_unique<bke::GizmoEditHints>();
2871 for (
auto item : src_gizmo_edit_hints->gizmo_transforms.items()) {
2872 component.gizmo_edit_hints_->gizmo_transforms.add(item.key, task.transform * item.value);
2893 if (reference.
type() == bke::InstanceReference::Type::GeometrySet) {
2911 inverse_selection_indices);
2913 if (inverse_selection.
is_empty()) {
2917 std::unique_ptr<Instances> new_instances = std::make_unique<Instances>(instances);
2918 new_instances->remove(inverse_selection, attribute_filter);
2929 return {geometry_set};
2952 return {geometry_set};
2957 geometry_set, varied_depth_option.
selection, not_to_realize_set,
options.attribute_filter);
2959 if (
options.keep_original_ids) {
2964 geometry_set,
options, varied_depth_option);
2968 geometry_set,
options, varied_depth_option);
2970 geometry_set,
options, varied_depth_option);
2979 all_grease_pencils_info,
2980 all_instance_attributes,
2981 create_id_attribute,
2983 varied_depth_option.
depths,
3005 attribute_fallbacks);
3011 all_instance_attributes,
3018 const int64_t approximate_used_bytes_num = total_points_num * 32;
3022 all_pointclouds_info,
3050 result.geometry.bundle_for_write().merge(*bundle);
Low-level operations for curves.
CustomData interface, see also DNA_customdata_types.h.
Low-level operations for grease pencil.
General operations, lookup, etc. for materials.
General operations for point clouds.
These structs are the foundation for all linked lists in the library system.
Object is a sort of wrapper for general info.
#define PRF_scope_with_name(ui_name, category)
#define PRF_scope(category)
#define BLI_assert_unreachable()
Span< T > as_span() const
IndexRange index_range() const
void reinitialize(const int64_t new_size)
bool is_equal(const void *a, const void *b) const
const void * default_value() const
void default_construct(void *ptr) const
GMutableSpan slice(const int64_t start, int64_t size) const
const CPPType & type() const
const CPPType * type() const
const CPPType & type() const
const CPPType & type() const
IndexRange index_range() const
VArray< T > typed() const
constexpr IndexRange()=default
constexpr bool contains(int64_t value) const
constexpr IndexRange drop_front(int64_t n) const
constexpr MutableSpan slice(const int64_t start, const int64_t size) const
constexpr bool is_empty() const
constexpr void fill(const T &value) const
constexpr IndexRange index_range() const
T & construct(Args &&...args)
void * allocate_owned(const CPPType &type)
bool add_as(ForwardKey &&key)
void ensure(FunctionRef< void(T &data)> compute_cache)
constexpr const T & first() const
constexpr int64_t size() const
constexpr IndexRange index_range() const
constexpr bool is_empty() const
std::optional< T > get_if_single() const
IndexRange index_range() const
void materialize(MutableSpan< T > r_span) const
T get_internal_single() const
Span< T > get_internal_span() const
static VArray from_single(T value, const int64_t size)
static VArray from_span(Span< T > values)
void append(const T &value)
IndexRange index_range() const
GAttributeReader lookup_or_default(StringRef name, AttrDomain domain, AttrType data_type, const void *default_value=nullptr) const
void foreach_attribute(const FunctionRef< void(const AttributeIter &)> fn) const
bool contains(StringRef name) const
GAttributeReader lookup(const StringRef name) const
GPointer get_builtin_default(const StringRef name) const
bool is_builtin(const StringRef name) const
GAttributeReader get() const
MutableSpan< float3 > positions_for_write()
AttributeAccessor attributes() const
MutableSpan< int > offsets_for_write()
void nurbs_custom_knots_resize(int knots_num)
MutableAttributeAccessor attributes_for_write()
void convert_to_uninitialized(const CPPType &from_type, const CPPType &to_type, const void *from_value, void *to_value) const
void convert_to_initialized_n(GSpan from_span, GMutableSpan to_span) const
bool is_convertible(const CPPType &from_type, const CPPType &to_type) const
int attribute_domain_size(AttrDomain domain) const
void to_geometry_set(GeometrySet &r_geometry_set) const
GeometrySet & geometry_set()
const Instances * get() const
GeometryComponentPtr copy() const override
void replace(Instances *instances, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
Span< int > reference_handles() const
Span< float4x4 > transforms() const
Span< InstanceReference > references() const
bke::MutableAttributeAccessor attributes_for_write()
bke::AttributeAccessor attributes() const
MutableSpan< InstanceReference > references_for_write()
int instances_num() const
void ensure_geometry_instances()
bool add(const StringRef name, const AttrDomain domain, const AttrType data_type, const AttributeInit &initializer)
GSpanAttributeWriter lookup_or_add_for_write_span(StringRef name, AttrDomain domain, AttrType data_type, const AttributeInit &initializer=AttributeInitDefaultValue())
bool remove(const StringRef name)
GSpanAttributeWriter lookup_or_add_for_write_only_span(StringRef name, AttrDomain domain, AttrType data_type)
bke::CurvesGeometry & strokes_for_write()
const bke::CurvesGeometry & strokes() const
void set_local_transform(const float4x4 &transform)
float4x4 local_transform() const
std::optional< bke::AttrDomain > result_domain
void add_mesh(const Mesh &mesh)
void copy_utf8_truncated(char *dst, int64_t dst_size) const
void foreach_index(Fn &&fn, Mode mode=exec_mode::serial) const
IndexMask complement(const IndexMask &universe, LinearAllocator<> &memory) const
CCL_NAMESPACE_BEGIN struct Options options
VecBase< short, 2 > short2
void gather(const GVArray &src, const IndexMask &indices, GMutableSpan dst, exec_mode::Mode mode=exec_mode::parallel)
void copy(const GVArray &src, GMutableSpan dst, exec_mode::Mode mode=exec_mode::parallel)
bool is_corner_fan_normals(const AttributeMetaData &meta_data)
void curves_copy_parameters(const Curves &src, Curves &dst)
ImplicitSharingPtr< GeometryComponent > GeometryComponentPtr
const DataTypeConversions & get_implicit_type_conversions()
bool attribute_is_builtin_on_component_type(const GeometryComponent::Type type, StringRef name)
void mesh_flip_faces(Mesh &mesh, const IndexMask &selection)
void mesh_transform(Mesh &mesh, const float4x4 &transform, bool do_shape_keys)
AttrType cpp_type_to_attribute_type(const CPPType &type)
const CPPType & attribute_type_to_cpp_type(AttrType type)
Curves * curves_new_nomain(int points_num, int curves_num)
static void propagate_instances_to_keep(const bke::GeometrySet &geometry_set, const IndexMask &selection, bke::GeometrySet &new_geometry_set, const bke::AttributeFilter &attribute_filter)
static void gather_realize_tasks_recursive(GatherTasksInfo &gather_info, const int current_depth, const int target_depth, const bke::GeometrySet &geometry_set, const float4x4 &base_transform, const InstanceContext &base_instance_context)
static Vector< AttrFallbackData > prepare_attribute_fallbacks(GatherTasksInfo &gather_info, const Instances &instances, const OrderedAttributes &ordered_attributes)
static OrderedAttributes gather_generic_pointcloud_attributes_to_propagate(const bke::GeometrySet &in_geometry_set, const RealizeInstancesOptions &options, const VariedDepthOptions &varied_depth_option, bool &r_create_radii, bool &r_create_id)
static void execute_realize_curve_tasks(const RealizeInstancesOptions &options, const GatherOffsets &offsets, const AllCurvesInfo &all_curves_info, const Span< RealizeCurveTask > tasks, const OrderedAttributes &ordered_attributes, RealizeInstancesResult &r_result)
static std::optional< int > calc_single_value_material_index(const AllMeshesInfo &all_meshes_info)
static void execute_realize_curve_task(const RealizeInstancesOptions &options, const AllCurvesInfo &all_curves_info, const RealizeCurveTask &task, const OrderedAttributes &ordered_attributes, bke::CurvesGeometry &dst_curves, MutableSpan< GSpanAttributeWriter > dst_attribute_writers, MutableSpan< int > all_dst_ids, MutableSpan< int > all_dst_fill_ids, MutableSpan< float3 > all_handle_left, MutableSpan< float3 > all_handle_right, MutableSpan< float > all_radii, MutableSpan< float3 > all_custom_normals)
static void execute_realize_grease_pencil_tasks(const AllGreasePencilsInfo &all_grease_pencils_info, const GatherOffsets &offsets, const Span< RealizeGreasePencilTask > tasks, const OrderedAttributes &ordered_attributes, RealizeInstancesResult &r_result)
static void execute_realize_mesh_tasks(const RealizeInstancesOptions &options, const GatherOffsets &offsets, const AllMeshesInfo &all_meshes_info, const Span< RealizeMeshTask > tasks, const OrderedAttributes &ordered_attributes, const VectorSet< Material * > &ordered_materials, RealizeInstancesResult &r_result)
static AllMeshesInfo preprocess_meshes(const bke::GeometrySet &geometry_set, const RealizeInstancesOptions &options, const VariedDepthOptions &varied_depth_option)
static void gather_grease_pencils_to_realize(const bke::GeometrySet &geometry_set, VectorSet< const GreasePencil * > &r_grease_pencils)
static OrderedAttributes gather_generic_curve_attributes_to_propagate(const bke::GeometrySet &in_geometry_set, const RealizeInstancesOptions &options, const VariedDepthOptions &varied_depth_option, bool &r_create_id, bool &r_create_fill_id)
static void execute_realize_pointcloud_task(const RealizeInstancesOptions &options, const RealizePointCloudTask &task, const OrderedAttributes &ordered_attributes, MutableSpan< GSpanAttributeWriter > dst_attribute_writers, MutableSpan< float > all_dst_radii, MutableSpan< int > all_dst_ids, MutableSpan< float3 > all_dst_positions)
static int64_t get_final_points_num(const GatherTasks &tasks)
static void gather_pointclouds_to_realize(const bke::GeometrySet &geometry_set, VectorSet< const PointCloud * > &r_pointclouds)
static std::optional< int > calc_material_index_max_hint(const Span< MeshRealizeInfo > infos)
static void execute_realize_grease_pencil_task(const RealizeGreasePencilTask &task, const OrderedAttributes &ordered_attributes, GreasePencil &dst_grease_pencil, MutableSpan< GSpanAttributeWriter > dst_attribute_writers)
static void copy_generic_attributes_to_result(const Span< std::optional< GVArray > > src_attributes, const AttributeFallbacksArray &attribute_fallbacks, const OrderedAttributes &ordered_attributes, const FunctionRef< IndexRange(bke::AttrDomain)> &range_fn, MutableSpan< GSpanAttributeWriter > dst_attribute_writers)
static VectorSet< int > gather_all_fill_ids(const VArray< int > &fill_ids)
static void gather_realize_tasks_for_instances(GatherTasksInfo &gather_info, const int current_depth, const int target_depth, const Instances &instances, const float4x4 &base_transform, const InstanceContext &base_instance_context)
static void remove_id_attribute_from_instances(bke::GeometrySet &geometry_set)
static void initialize_curves_builtin_attribute_defaults(const AllCurvesInfo &all_curves_info, InstanceContext &attribute_fallbacks)
static void gather_curves_to_realize(const bke::GeometrySet &geometry_set, VectorSet< const Curves * > &r_curves)
static void transform_grease_pencil_layers(Span< bke::greasepencil::Layer * > layers, const float4x4 &transform)
static bool valid_int_num(const int64_t num)
static bool try_join_single_value_attribute(const int tasks_num, const OrderedAttributes &ordered_attributes, const FunctionRef< TaskAttrInfo(int)> get_task_attributes, const int attr_index, bke::MutableAttributeAccessor dst_attributes)
static void copy_vertex_group_name(ListBaseT< bDeformGroup > *dst_deform_group, const OrderedAttributes &ordered_attributes, const bDeformGroup &src_deform_group)
static void gather_attribute_propagation_components_with_custom_depths(const bke::GeometrySet &geometry, const bke::GeometryComponent::Type component_type, const RealizeInstancesOptions &options, const VariedDepthOptions &varied_depth_option, Set< bke::GeometryComponentPtr > &r_components)
static AllPointCloudsInfo preprocess_pointclouds(const bke::GeometrySet &geometry_set, const RealizeInstancesOptions &options, const VariedDepthOptions &varied_depth_option)
static int get_mapped_material_index(const MeshRealizeInfo &info, const int index)
static bke::GeometrySet::GatheredAttributes gather_attributes_to_propagate(const bke::GeometrySet &geometry, const bke::GeometryComponent::Type component_type, const RealizeInstancesOptions &options, const VariedDepthOptions &varied_depth_option)
static void create_result_ids(const RealizeInstancesOptions &options, const VArray< int > &stored_ids, const int task_id, MutableSpan< int > dst_ids)
static void copy_vertex_group_names(Mesh &dst_mesh, const OrderedAttributes &ordered_attributes, const Span< const Mesh * > src_meshes)
RealizeInstancesResult realize_instances(bke::GeometrySet geometry_set, const RealizeInstancesOptions &options)
static void execute_realize_pointcloud_tasks(const RealizeInstancesOptions &options, const GatherOffsets &offsets, const AllPointCloudsInfo &all_pointclouds_info, const Span< RealizePointCloudTask > tasks, const OrderedAttributes &ordered_attributes, RealizeInstancesResult &r_result)
static AllCurvesInfo preprocess_curves(const bke::GeometrySet &geometry_set, const RealizeInstancesOptions &options, const VariedDepthOptions &varied_depth_option)
static void gather_meshes_to_realize(const bke::GeometrySet &geometry_set, VectorSet< const Mesh * > &r_meshes)
static void add_instance_attributes_to_single_geometry(const OrderedAttributes &ordered_attributes, const AttributeFallbacksArray &attribute_fallbacks, bke::MutableAttributeAccessor attributes)
static void execute_instances_tasks(const Span< bke::GeometryComponentPtr > src_components, const Span< float4x4 > src_base_transforms, const OrderedAttributes &all_instances_attributes, const Span< geometry::AttributeFallbacksArray > attribute_fallback, bke::GeometrySet &r_realized_geometry)
static AllGreasePencilsInfo preprocess_grease_pencils(const bke::GeometrySet &geometry_set, const RealizeInstancesOptions &options, const VariedDepthOptions &varied_depth_options)
static OrderedAttributes gather_generic_instance_attributes_to_propagate(const bke::GeometrySet &in_geometry_set, const RealizeInstancesOptions &options, const VariedDepthOptions &varied_depth_option)
static void execute_realize_mesh_task(const RealizeInstancesOptions &options, const RealizeMeshTask &task, const OrderedAttributes &ordered_attributes, MutableSpan< GSpanAttributeWriter > dst_attribute_writers, MutableSpan< float3 > all_dst_positions, MutableSpan< int2 > all_dst_edges, MutableSpan< int > all_dst_face_offsets, MutableSpan< int > all_dst_corner_verts, MutableSpan< int > all_dst_corner_edges, MutableSpan< int > all_dst_vert_ids, GSpanAttributeWriter &all_dst_custom_normals, MutableSpan< int > all_dst_origindex_vert, MutableSpan< int > all_dst_origindex_edge, MutableSpan< int > all_dst_origindex_face)
static void foreach_geometry_in_reference(const InstanceReference &reference, const float4x4 &base_transform, const uint32_t id, FunctionRef< void(const bke::GeometrySet &geometry_set, const float4x4 &transform, uint32_t id)> fn)
static void threaded_fill(const GPointer value, GMutableSpan dst)
static void execute_realize_edit_data_tasks(const Span< RealizeEditDataTask > tasks, bke::GeometrySet &r_realized_geometry)
static bool skip_transform(const float4x4 &transform)
static OrderedAttributes gather_generic_grease_pencil_attributes_to_propagate(const bke::GeometrySet &in_geometry_set, const RealizeInstancesOptions &options, const VariedDepthOptions &varied_depth_options)
static void threaded_copy(const GVArray &src, GMutableSpan dst)
static void gather_attribute_propagation_components(const bke::GeometrySet &geometry, const bke::GeometryComponent::Type component_type, const RealizeInstancesOptions &options, const int current_depth, const std::optional< int > max_depth, Set< bke::GeometryComponentPtr > &r_components)
static void join_mesh_material_indices(const AllMeshesInfo &all_meshes_info, const Span< RealizeMeshTask > tasks, Mesh &dst_mesh)
static OrderedAttributes gather_generic_mesh_attributes_to_propagate(const bke::GeometrySet &in_geometry_set, const RealizeInstancesOptions &options, const VariedDepthOptions &varied_depth_option, bool &r_create_id, bool &r_create_material_index)
bool is_negative(const MatBase< T, 3, 3 > &mat)
void transform_normals(const float3x3 &transform, MutableSpan< float3 > normals)
bool is_equal(const MatBase< T, NumCol, NumRow > &a, const MatBase< T, NumCol, NumRow > &b, const T epsilon=T(0))
void transform_points(const float4x4 &transform, MutableSpan< float3 > points, bool use_threading=true)
constexpr StringRefNull radius
uint32_t hash(uint32_t kx)
OffsetIndices< int > accumulate_counts_to_offsets(MutableSpan< int > counts_to_offsets, int start_offset=0)
void parallel_for(const IndexRange range, const int64_t grain_size, const Function &function, const TaskSizeHints &size_hints=detail::TaskSizeHints_Static(1))
void memory_bandwidth_bound_task(const int64_t approximate_bytes_touched, const Function &function)
Value parallel_reduce(IndexRange range, int64_t grain_size, const Value &identity, const Function &function, const Reduction &reduction)
PointCloud * BKE_pointcloud_copy_for_eval(const PointCloud *pointcloud_src)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void BKE_id_material_eval_assign(ID *id, int slot, Material *material)
GreasePencil * BKE_grease_pencil_copy_for_eval(const GreasePencil *grease_pencil_src)
bool CustomData_has_layer(const CustomData *data, eCustomDataType type)
Mesh * BKE_mesh_copy_for_eval(const Mesh &source)
struct Curves * BKE_curves_copy_for_eval(const struct Curves *curves_src)
MatBase< float, 4, 4 > float4x4
void BKE_grease_pencil_copy_layer_parameters(const bke::greasepencil::Layer &src, bke::greasepencil::Layer &dst)
void BKE_mesh_copy_parameters_for_eval(Mesh *me_dst, const Mesh *me_src)
BMesh const char void * data
void BKE_grease_pencil_copy_parameters(const GreasePencil &src, GreasePencil &dst)
Mesh * BKE_mesh_new_nomain(int verts_num, int edges_num, int faces_num, int corners_num)
const void * CustomData_get_layer(const CustomData *data, eCustomDataType type)
ATTR_WARN_UNUSED_RESULT const size_t num
MatBase< float, 3, 3 > float3x3
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
VecBase< int16_t, 2 > short2
PointCloud * BKE_pointcloud_new_nomain(PointCloudType type, int totpoint)
VecBase< float, 3 > float3
GreasePencil * BKE_grease_pencil_new_nomain()
void uninitialized_copy_n(const T *src, int64_t n, T *dst)
void * MEM_new_array_zeroed(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
void * CustomData_add_layer(CustomData *data, eCustomDataType type, eCDAllocType alloctype, int totelem)
ListBaseT< struct bDeformGroup > vertex_group_names
static MatBase identity()
ListBaseT< bDeformGroup > vertex_group_names
bke::MeshRuntime * runtime
int vertex_group_active_index
bool allow_skip(const StringRef name) const
void add(const StringRef name, const AttributeDomainAndType &kind)
Vector< AttributeDomainAndType, 16 > kinds
VectorSet< StringRef, 16 > names
GeometryComponent & get_component_for_write(GeometryComponent::Type component_type)
Instances * get_instances_for_write()
const GreasePencil * get_grease_pencil() const
Vector< const GeometryComponent * > get_components() const
void replace_pointcloud(PointCloud *pointcloud, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
const nodes::Bundle * bundle() const
const Curves * get_curves() const
const Instances * get_instances() const
bool has_instances() const
void replace_curves(Curves *curves, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
const PointCloud * get_pointcloud() const
const Mesh * get_mesh() const
void replace_mesh(Mesh *mesh, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
void replace_grease_pencil(GreasePencil *grease_pencil, GeometryOwnershipType ownership=GeometryOwnershipType::Owned)
SharedCache< std::optional< int > > max_material_index
MutableVArraySpan< T > span
bool create_handle_postion_attributes
OrderedAttributes attributes
bool create_radius_attribute
bool create_fill_id_attribute
bool create_custom_normal_attribute
VectorSet< const Curves * > order
Array< RealizeCurveInfo > realize_info
VectorSet< Material * > materials
VectorSet< const GreasePencil * > order
OrderedAttributes attributes
Array< GreasePencilRealizeInfo > realize_info
Vector< AttributeFallbacksArray > attribute_fallback
Vector< float4x4 > instances_components_transforms
Vector< bke::GeometryComponentPtr > instances_components_to_merge
bool create_origindex_edge_attribute
bool create_origindex_vert_attribute
VectorSet< Material * > materials
VectorSet< const Mesh * > order
bool create_origindex_face_attribute
bke::mesh::NormalJoinInfo custom_normal_info
bool create_material_index_attribute
OrderedAttributes attributes
Array< MeshRealizeInfo > realize_info
Array< PointCloudRealizeInfo > realize_info
VectorSet< const PointCloud * > order
OrderedAttributes attributes
bool create_radius_attribute
std::variant< GSpan, GPointer > data
AttributeFallbacksArray(int size)
Array< const void * > array
int64_t grease_pencil_layer_offset
struct blender::geometry::GatherOffsets::@126330241025251350205004126146067057057341077305 curves_offsets
int64_t pointcloud_offset
struct blender::geometry::GatherOffsets::@312066275037000240171062267334372124230202046235 mesh_offsets
const AllPointCloudsInfo & pointclouds
ResourceScope & r_temporary_arrays
const AllCurvesInfo & curves
const VArray< int > & depths
const AllMeshesInfo & meshes
bool create_id_attribute_on_any_component
AllInstancesInfo instances
const OrderedAttributes & instances_attriubutes
const AllGreasePencilsInfo & grease_pencils
Vector< RealizeMeshTask > mesh_tasks
Vector< RealizeEditDataTask > edit_data_tasks
Vector< RealizePointCloudTask > pointcloud_tasks
Vector< RealizeCurveTask > curve_tasks
ImplicitSharingPtr< const bke::VolumeComponent > first_volume
Vector< RealizeGreasePencilTask > grease_pencil_tasks
VectorSet< const nodes::Bundle * > bundles
Array< std::optional< GVArray > > attributes
Array< int > material_index_map
const GreasePencil * grease_pencil
AttributeFallbacksArray grease_pencils
AttributeFallbacksArray instances
InstanceContext(const GatherTasksInfo &gather_info)
AttributeFallbacksArray meshes
AttributeFallbacksArray pointclouds
AttributeFallbacksArray curves
VArray< int > material_indices
GVArraySpan custom_normal
VArray< int > stored_vert_ids
OffsetIndices< int > faces
Array< int > material_index_map
Array< std::optional< GVArray > > attributes
IndexRange index_range() const
Vector< AttributeDomainAndType > kinds
VectorSet< StringRef > names
Array< std::optional< GVArray > > attributes
const PointCloud * pointcloud
Span< float3 > custom_normal
Span< float3 > handle_left
Array< std::optional< GVArray > > attributes
VArray< int > stored_fill_ids
Span< float3 > handle_right
VectorSet< int > index_by_fill_id
Span< float > nurbs_weight
const RealizeCurveInfo * curve_info
AttributeFallbacksArray attribute_fallbacks
CurvesElementStartIndices start_indices
const bke::GeometryComponentEditData * edit_data
AttributeFallbacksArray attribute_fallbacks
const GreasePencilRealizeInfo * grease_pencil_info
bke::GeometrySet geometry
Vector< std::string > errors
AttributeFallbacksArray attribute_fallbacks
const MeshRealizeInfo * mesh_info
MeshElementStartIndices start_indices
AttributeFallbacksArray attribute_fallbacks
const PointCloudRealizeInfo * pointcloud_info
const AttributeFallbacksArray & fallbacks
Span< std::optional< GVArray > > attributes
static constexpr int MAX_DEPTH