Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/geometry_set.cc
| Show First 20 Lines • Show All 452 Lines • ▼ Show 20 Lines | this->attribute_foreach( | ||||
| attribute_kind->data_type = bke::attribute_data_type_highest_complexity( | attribute_kind->data_type = bke::attribute_data_type_highest_complexity( | ||||
| {attribute_kind->data_type, meta_data.data_type}); | {attribute_kind->data_type, meta_data.data_type}); | ||||
| }; | }; | ||||
| r_attributes.add_or_modify(attribute_id, add_info, modify_info); | r_attributes.add_or_modify(attribute_id, add_info, modify_info); | ||||
| }); | }); | ||||
| delete dummy_component; | delete dummy_component; | ||||
| } | } | ||||
| /** | |||||
| * Modify every (recursive) instance separately. This is often more efficient than to realize all | |||||
HooglyBoogly: `than to realize` -> `than realizing` | |||||
| * instances just to change the same thing on all of them. | |||||
| */ | |||||
| void GeometrySet::modify_geometry_sets(ForeachSubGeometryCallback callback) | |||||
| { | |||||
| callback(*this); | |||||
| if (!this->has_instances()) { | |||||
| return; | |||||
| } | |||||
| /* In the future this can be improved by deduplicating instance references across different | |||||
| * instances. */ | |||||
| InstancesComponent &instances_component = this->get_component_for_write<InstancesComponent>(); | |||||
| instances_component.ensure_geometry_instances(); | |||||
| for (const int handle : instances_component.references().index_range()) { | |||||
| GeometrySet &instance_geometry = instances_component.geometry_set_from_reference(handle); | |||||
| instance_geometry.modify_geometry_sets(callback); | |||||
| } | |||||
| } | |||||
| /** \} */ | /** \} */ | ||||
| /* -------------------------------------------------------------------- */ | /* -------------------------------------------------------------------- */ | ||||
| /** \name C API | /** \name C API | ||||
| * \{ */ | * \{ */ | ||||
| void BKE_geometry_set_free(GeometrySet *geometry_set) | void BKE_geometry_set_free(GeometrySet *geometry_set) | ||||
| { | { | ||||
| Show All 32 Lines | |||||
than to realize -> than realizing