[Bf-blender-cvs] [c18675b12c6] master: Cleanup: Add comment explaining assert

Hans Goudey noreply at git.blender.org
Fri Jun 4 00:06:52 CEST 2021


Commit: c18675b12c66ccfc96079a67dc65a2eb978af7bd
Author: Hans Goudey
Date:   Thu Jun 3 18:06:14 2021 -0400
Branches: master
https://developer.blender.org/rBc18675b12c66ccfc96079a67dc65a2eb978af7bd

Cleanup: Add comment explaining assert

This triggers fairly often during development, so it might save some
frustration at some point to have a comment here.

===================================================================

M	source/blender/blenkernel/intern/attribute_access.cc

===================================================================

diff --git a/source/blender/blenkernel/intern/attribute_access.cc b/source/blender/blenkernel/intern/attribute_access.cc
index 1495eb23254..f2ad873b10e 100644
--- a/source/blender/blenkernel/intern/attribute_access.cc
+++ b/source/blender/blenkernel/intern/attribute_access.cc
@@ -658,6 +658,7 @@ GVArrayPtr CustomDataAttributes::get_for_read(const StringRef name,
 
 std::optional<GMutableSpan> CustomDataAttributes::get_for_write(const StringRef name)
 {
+  /* If this assert hits, it most likely means that #reallocate was not called at some point. */
   BLI_assert(size_ != 0);
   for (CustomDataLayer &layer : MutableSpan(data.layers, data.totlayer)) {
     if (layer.name == name) {



More information about the Bf-blender-cvs mailing list