diff options
author | Jacques Lucke <jacques@blender.org> | 2021-10-30 20:59:35 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-10-30 20:59:35 +0300 |
commit | e79c7e088e35e3901582aaee82284680de2e3373 (patch) | |
tree | 8b056ec38e891158e9c96e5a65d14ee3753cc0e2 | |
parent | 99c5b788ebeee810c7d4df02ac917dee3e98403b (diff) |
progress
-rw-r--r-- | source/blender/blenkernel/intern/mesh_sample.cc | 2 | ||||
-rw-r--r-- | source/blender/functions/FN_generic_virtual_array.hh | 19 |
2 files changed, 14 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/mesh_sample.cc b/source/blender/blenkernel/intern/mesh_sample.cc index 42dd318da38..e0b6053acbe 100644 --- a/source/blender/blenkernel/intern/mesh_sample.cc +++ b/source/blender/blenkernel/intern/mesh_sample.cc @@ -222,7 +222,7 @@ void MeshAttributeInterpolator::sample_data(const GVArray &src, const eAttributeMapMode mode, const GMutableSpan dst) { - if (src->is_empty() || dst.is_empty()) { + if (src.is_empty() || dst.is_empty()) { return; } diff --git a/source/blender/functions/FN_generic_virtual_array.hh b/source/blender/functions/FN_generic_virtual_array.hh index a8012b52f8c..37bbaca5a59 100644 --- a/source/blender/functions/FN_generic_virtual_array.hh +++ b/source/blender/functions/FN_generic_virtual_array.hh @@ -54,7 +54,6 @@ class GVArrayImpl { const CPPType &type() const; int64_t size() const; - bool is_empty() const; void get(const int64_t index, void *r_value) const; void get_to_uninitialized(const int64_t index, void *r_value) const; @@ -206,6 +205,19 @@ class GVArrayCommon { return impl_ != nullptr; } + int64_t size() const + { + if (impl_ == nullptr) { + return 0; + } + return impl_->size(); + } + + bool is_empty() const + { + return this->size() == 0; + } + template<typename T> bool try_assign_VArray(VArray<T> &varray) const; bool has_ownership() const; @@ -666,11 +678,6 @@ inline int64_t GVArrayImpl::size() const return size_; } -inline bool GVArrayImpl::is_empty() const -{ - return size_ == 0; -} - /* Copies the value at the given index into the provided storage. The `r_value` pointer is * expected to point to initialized memory. */ inline void GVArrayImpl::get(const int64_t index, void *r_value) const |