From 79df0351d41a2d2ddcdca9dea09252c99e9446fc Mon Sep 17 00:00:00 2001 From: Sean Kim Date: Thu, 27 Feb 2025 02:15:36 +0100 Subject: [PATCH] Spreadsheet: Expose `.sculpt` and `.hide` attributes behind debug option This commit adds five commonly used internal Sculpt Mode attributes to the Spreadsheet editor when `--debug-value 4001` is passed in to assist with development and debugging of issues. The whitelisted attributes are: * `.sculpt_mask` * `.sculpt_face_set` * `.hide_vert` * `.hide_poly` * `.hide_edge` And are displayed after the other existing debug columns. Pull Request: https://projects.blender.org/blender/blender/pulls/135201 --- .../spreadsheet_data_source_geometry.cc | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc index c3e4fcd5f49..6f8881fd5b3 100644 --- a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc +++ b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc @@ -75,17 +75,30 @@ static void add_mesh_debug_column_names( const bke::AttrDomain domain, FunctionRef fn) { + const bke::AttributeAccessor attributes = mesh.attributes(); + auto add_attribute = [&](const StringRefNull name) { + if (const std::optional meta_data = attributes.lookup_meta_data(name)) + { + if (meta_data->domain == domain) { + fn({(char *)name.c_str()}, false); + } + } + }; + switch (domain) { case bke::AttrDomain::Point: if (CustomData_has_layer(&mesh.vert_data, CD_ORIGINDEX)) { fn({(char *)"Original Index"}, false); } + add_attribute(".sculpt_mask"); + add_attribute(".hide_vert"); break; case bke::AttrDomain::Edge: if (CustomData_has_layer(&mesh.edge_data, CD_ORIGINDEX)) { fn({(char *)"Original Index"}, false); } fn({(char *)"Vertices"}, false); + add_attribute(".hide_edge"); break; case bke::AttrDomain::Face: if (CustomData_has_layer(&mesh.face_data, CD_ORIGINDEX)) { @@ -93,6 +106,8 @@ static void add_mesh_debug_column_names( } fn({(char *)"Corner Start"}, false); fn({(char *)"Corner Size"}, false); + add_attribute(".sculpt_face_set"); + add_attribute(".hide_poly"); break; case bke::AttrDomain::Corner: fn({(char *)"Vertex"}, false);