Fix: Reversed attribute is_internal RNA property

`is_internal` is supposed to mean that the attribute shouldn't be
visible in lists or the spreadsheet by default, and that it can't be
accessed in geometry nodes. But the value was reversed, which
just happened to work because the list filtering was swapped.

Differential Revision: https://developer.blender.org/D16680
This commit is contained in:
Hans Goudey 2022-12-02 11:21:54 -06:00
parent e2f6fb5d35
commit 99dc90accc
Notes: blender-bot 2023-02-21 17:59:30 +01:00
Referenced by issue #100749, Blender LTS: Maintenance Task 3.3
4 changed files with 6 additions and 6 deletions

View File

@ -89,7 +89,7 @@ class CURVES_UL_attributes(UIList):
indices = [i for i in range(len(attributes))]
for item in attributes:
flags.append(self.bitflag_filter_item if item.is_internal else 0)
flags.append(0 if item.is_internal else self.bitflag_filter_item)
return flags, indices

View File

@ -536,7 +536,7 @@ class MESH_UL_attributes(UIList):
indices = [i for i in range(len(attributes))]
for item in attributes:
flags.append(self.bitflag_filter_item if item.is_internal else 0)
flags.append(0 if item.is_internal else self.bitflag_filter_item)
return flags, indices
@ -632,9 +632,9 @@ class ColorAttributesListBase():
skip = (
(item.domain not in {"POINT", "CORNER"}) or
(item.data_type not in {"FLOAT_COLOR", "BYTE_COLOR"}) or
(not item.is_internal)
item.is_internal
)
ret.append(self.bitflag_filter_item if not skip else 0)
ret.append(0 if skip else self.bitflag_filter_item)
idxs.append(idx)
return ret, idxs

View File

@ -71,7 +71,7 @@ class POINTCLOUD_UL_attributes(UIList):
indices = [i for i in range(len(attributes))]
for item in attributes:
flags.append(self.bitflag_filter_item if item.is_internal else 0)
flags.append(0 if item.is_internal else self.bitflag_filter_item)
return flags, indices

View File

@ -251,7 +251,7 @@ static int rna_Attribute_domain_get(PointerRNA *ptr)
static bool rna_Attribute_is_internal_get(PointerRNA *ptr)
{
const CustomDataLayer *layer = (const CustomDataLayer *)ptr->data;
return BKE_attribute_allow_procedural_access(layer->name);
return !BKE_attribute_allow_procedural_access(layer->name);
}
static void rna_Attribute_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr)