Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2022-01-21 09:10:54 +0300
committerHans Goudey <h.goudey@me.com>2022-01-21 09:10:54 +0300
commiteed8d20b973231efb11bad0dd690033b26825280 (patch)
treeefbd8e9bffb8465ff5649e200f7f853b195d8e79
parent9025b09144960baf359d584679eb743db7aa1b1a (diff)
Cleanup: Add comments
-rw-r--r--source/blender/blenkernel/intern/customdata.cc1
-rw-r--r--source/blender/nodes/geometry/nodes/node_geo_extrude_mesh.cc7
2 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/customdata.cc b/source/blender/blenkernel/intern/customdata.cc
index 97b84802150..5c8d3988750 100644
--- a/source/blender/blenkernel/intern/customdata.cc
+++ b/source/blender/blenkernel/intern/customdata.cc
@@ -2209,6 +2209,7 @@ void CustomData_realloc(CustomData *data, int totelem)
continue;
}
typeInfo = layerType_getInfo(layer->type);
+ /* Use calloc to avoid the need to manually initialize new data in layers. */
layer->data = MEM_recallocN(layer->data, (size_t)totelem * typeInfo->size);
}
}
diff --git a/source/blender/nodes/geometry/nodes/node_geo_extrude_mesh.cc b/source/blender/nodes/geometry/nodes/node_geo_extrude_mesh.cc
index 7ebe24f71e3..9c9909ac222 100644
--- a/source/blender/nodes/geometry/nodes/node_geo_extrude_mesh.cc
+++ b/source/blender/nodes/geometry/nodes/node_geo_extrude_mesh.cc
@@ -84,6 +84,9 @@ static void save_selection_as_attribute(MeshComponent &component,
OutputAttribute_Typed<bool> attribute = component.attribute_try_get_for_output_only<bool>(
id, domain);
+ /* Rely on the new attribute being zeroed by default. */
+ BLI_assert(!attribute.as_span().as_span().contains(true));
+
if (selection.is_range()) {
attribute.as_span().slice(selection.as_range()).fill(true);
}
@@ -119,6 +122,10 @@ static MutableSpan<MLoop> mesh_loops(Mesh &mesh)
return {mesh.mloop, mesh.totloop};
}
+/**
+ * \note: Some areas in this file rely on the new sections of attributes in #CustomData_realloc to
+ * be zeroed.
+ */
static void expand_mesh(Mesh &mesh,
const int vert_expand,
const int edge_expand,