diff options
author | Jacques Lucke <jacques@blender.org> | 2021-04-23 13:44:59 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2021-04-23 13:44:59 +0300 |
commit | 4cb8438e08cb64d755f627c8eeb3e8cda73864f1 (patch) | |
tree | ba27a73986f9d0477e3c77cc6d88dc165fcafca7 /source/blender/blenkernel/intern | |
parent | f8e1526fa61b8a79b6514e4f265586732d28280d (diff) |
Geometry Nodes: warn when output attribute has not been saved
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/attribute_access.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/attribute_access.cc b/source/blender/blenkernel/intern/attribute_access.cc index 6c37d34dc9b..5b2f588959f 100644 --- a/source/blender/blenkernel/intern/attribute_access.cc +++ b/source/blender/blenkernel/intern/attribute_access.cc @@ -184,6 +184,7 @@ AttributeDomain attribute_domain_highest_priority(Span<AttributeDomain> domains) void OutputAttribute::save() { + save_has_been_called_ = true; if (optional_span_varray_.has_value()) { optional_span_varray_->save(); } @@ -192,6 +193,15 @@ void OutputAttribute::save() } } +OutputAttribute::~OutputAttribute() +{ + if (!save_has_been_called_) { + if (varray_) { + std::cout << "Warning: Call `save()` to make sure that changes persist in all cases.\n"; + } + } +} + GVArrayPtr BuiltinCustomDataLayerProvider::try_get_for_read( const GeometryComponent &component) const { |