diff options
author | Hans Goudey <h.goudey@me.com> | 2022-05-31 14:20:16 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-05-31 14:20:16 +0300 |
commit | 4669178fc3786e1aebb117892d8dc6a2ce4dc955 (patch) | |
tree | 3680859a3b4337bd91669bd9a048afcbe46d6ba3 /source/blender/makesrna/intern/rna_attribute.c | |
parent | 39c14f4e84c0813241659c9b56bef5a62d55e6c8 (diff) |
Attributes: Hide internal UI attributes and disallow procedural access
This commit hides "UI attributes" described in T97452 from the UI lists
in mesh, curve, and point cloud properties, and disallow accessing them
in geometry nodes.
Internal UI attributes like selection and hiding values should use the
attribute system for simplicity and performance, but we don't want to
expose those attributes in the attribute panel, which is meant for
regular user interaction. Procedural access may be misleading or cause
problems, as described in the design task above.
These attributes are added by two upcoming patches: D14934, D14685
Differential Revision: https://developer.blender.org/D15069
Diffstat (limited to 'source/blender/makesrna/intern/rna_attribute.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_attribute.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_attribute.c b/source/blender/makesrna/intern/rna_attribute.c index 36706c82366..0cea693cd2a 100644 --- a/source/blender/makesrna/intern/rna_attribute.c +++ b/source/blender/makesrna/intern/rna_attribute.c @@ -232,6 +232,12 @@ static int rna_Attribute_domain_get(PointerRNA *ptr) return BKE_id_attribute_domain(ptr->owner_id, ptr->data); } +static bool rna_Attribute_is_internal_get(PointerRNA *ptr) +{ + const CustomDataLayer *layer = (const CustomDataLayer *)ptr->data; + return BKE_attribute_allow_procedural_access(layer->name); +} + static void rna_Attribute_data_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { ID *id = ptr->owner_id; @@ -930,6 +936,12 @@ static void rna_def_attribute(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Domain", "Domain of the Attribute"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); + prop = RNA_def_property(srna, "is_internal", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_funcs(prop, "rna_Attribute_is_internal_get", NULL); + RNA_def_property_ui_text( + prop, "Is Internal", "The attribute is meant for internal use by Blender"); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + /* types */ rna_def_attribute_float(brna); rna_def_attribute_float_vector(brna); @@ -942,7 +954,7 @@ static void rna_def_attribute(BlenderRNA *brna) rna_def_attribute_int8(brna); } -/* Mesh/PointCloud/Hair.attributes */ +/* Mesh/PointCloud/Curves.attributes */ static void rna_def_attribute_group(BlenderRNA *brna) { StructRNA *srna; |