From a50ca6a1cd72aa0556d74dd4a54de25bf2eeadcb Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Thu, 1 Sep 2022 13:55:20 +0200 Subject: Fix T100687: Geometry Attribute Convert crashes in sculpt mode Since above commit, `BKE_id_attributes_active_get` would also return "internal" attributes like ".hide_poly" or ".hide_vert". As a consequence, a couple of poll functions dont return false anymore (attribute remove, attribute convert), allowing these operators to execute, but acting on this "internal" layers is just asking for trouble. In the UI, we dont see these attributes, because `MESH_UL_attributes` checks `is_internal`, same thing we do now in `BKE_id_attributes_active_get`. Maniphest Tasks: T100687 Differential Revision: https://developer.blender.org/D15833 --- source/blender/blenkernel/intern/attribute.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/attribute.cc b/source/blender/blenkernel/intern/attribute.cc index 495a2c82332..e9593b49047 100644 --- a/source/blender/blenkernel/intern/attribute.cc +++ b/source/blender/blenkernel/intern/attribute.cc @@ -473,7 +473,7 @@ CustomDataLayer *BKE_id_attributes_active_get(ID *id) for (int i = 0; i < customdata->totlayer; i++) { CustomDataLayer *layer = &customdata->layers[i]; if (CD_MASK_PROP_ALL & CD_TYPE_AS_MASK(layer->type)) { - if (index == active_index) { + if (index == active_index && BKE_attribute_allow_procedural_access(layer->name)) { return layer; } index++; -- cgit v1.2.3