Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/geometry_component_volume.cc
| Show First 20 Lines • Show All 91 Lines • ▼ Show 20 Lines | Volume *VolumeComponent::get_for_write() | ||||
| BLI_assert(this->is_mutable()); | BLI_assert(this->is_mutable()); | ||||
| if (ownership_ == GeometryOwnershipType::ReadOnly) { | if (ownership_ == GeometryOwnershipType::ReadOnly) { | ||||
| volume_ = BKE_volume_copy_for_eval(volume_, false); | volume_ = BKE_volume_copy_for_eval(volume_, false); | ||||
| ownership_ = GeometryOwnershipType::Owned; | ownership_ = GeometryOwnershipType::Owned; | ||||
| } | } | ||||
| return volume_; | return volume_; | ||||
| } | } | ||||
| bool VolumeComponent::owns_direct_data() const | |||||
| { | |||||
| return ownership_ == GeometryOwnershipType::Owned; | |||||
| } | |||||
| void VolumeComponent::ensure_owns_direct_data() | |||||
| { | |||||
| BLI_assert(this->is_mutable()); | |||||
| if (ownership_ != GeometryOwnershipType::Owned) { | |||||
| volume_ = BKE_volume_copy_for_eval(volume_, false); | |||||
| ownership_ = GeometryOwnershipType::Owned; | |||||
| } | |||||
| } | |||||
| /** \} */ | /** \} */ | ||||