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 /release/scripts/startup/bl_ui/properties_data_curves.py | |
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 'release/scripts/startup/bl_ui/properties_data_curves.py')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_data_curves.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/release/scripts/startup/bl_ui/properties_data_curves.py b/release/scripts/startup/bl_ui/properties_data_curves.py index 4eefd5a0e0c..cf7117f2c85 100644 --- a/release/scripts/startup/bl_ui/properties_data_curves.py +++ b/release/scripts/startup/bl_ui/properties_data_curves.py @@ -78,6 +78,16 @@ class CURVES_MT_add_attribute(Menu): class CURVES_UL_attributes(UIList): + def filter_items(self, context, data, property): + attributes = getattr(data, property) + flags = [] + indices = [i for i in range(len(attributes))] + + for index, item in enumerate(attributes): + flags.append(self.bitflag_filter_item if item.is_internal else 0) + + return flags, indices + def draw_item(self, _context, layout, _data, attribute, _icon, _active_data, _active_propname, _index): data_type = attribute.bl_rna.properties['data_type'].enum_items[attribute.data_type] domain = attribute.bl_rna.properties['domain'].enum_items[attribute.domain] |