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
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user