Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/geometry_set.cc
| Show First 20 Lines • Show All 298 Lines • ▼ Show 20 Lines | bool GeometrySet::has_realized_data() const | ||||
| } | } | ||||
| if (components_.size() > 1) { | if (components_.size() > 1) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| /* Check if the only component is an #InstancesComponent. */ | /* Check if the only component is an #InstancesComponent. */ | ||||
| return this->get_component_for_read<InstancesComponent>() == nullptr; | return this->get_component_for_read<InstancesComponent>() == nullptr; | ||||
| } | } | ||||
| /* Return true if the geometry set has any component that isn't empty. */ | |||||
| bool GeometrySet::is_empty() const | |||||
| { | |||||
| if (components_.is_empty()) { | |||||
| return true; | |||||
| } | |||||
| return !(this->has_mesh() || this->has_curve() || this->has_pointcloud() || | |||||
| this->has_instances()); | |||||
| } | |||||
| /* Create a new geometry set that only contains the given mesh. */ | /* Create a new geometry set that only contains the given mesh. */ | ||||
| GeometrySet GeometrySet::create_with_mesh(Mesh *mesh, GeometryOwnershipType ownership) | GeometrySet GeometrySet::create_with_mesh(Mesh *mesh, GeometryOwnershipType ownership) | ||||
| { | { | ||||
| GeometrySet geometry_set; | GeometrySet geometry_set; | ||||
| MeshComponent &component = geometry_set.get_component_for_write<MeshComponent>(); | MeshComponent &component = geometry_set.get_component_for_write<MeshComponent>(); | ||||
| component.replace(mesh, ownership); | component.replace(mesh, ownership); | ||||
| return geometry_set; | return geometry_set; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 208 Lines • Show Last 20 Lines | |||||