Fix #116011: Sorting Attributes by Name in UILists does not work #116629

Merged
Philipp Oeser merged 1 commits from lichtwerk/blender:116011 into main 2024-01-09 09:26:16 +01:00
3 changed files with 16 additions and 0 deletions

View File

@ -112,6 +112,10 @@ class CURVES_UL_attributes(UIList):
for idx, item in enumerate(attributes):
flags[idx] = 0 if item.is_internal else flags[idx]
# Reorder by name.
if self.use_filter_sort_alpha:
indices = bpy.types.UI_UL_list.sort_items_by_name(attributes, "name")
return flags, indices
def draw_item(self, _context, layout, _data, attribute, _icon, _active_data, _active_propname, _index):

View File

@ -495,6 +495,10 @@ class MESH_UL_attributes(UIList):
for idx, item in enumerate(attributes):
flags[idx] = 0 if item.is_internal else flags[idx]
# Reorder by name.
if self.use_filter_sort_alpha:
indices = bpy.types.UI_UL_list.sort_items_by_name(attributes, "name")
return flags, indices
def draw_item(self, _context, layout, _data, attribute, _icon, _active_data, _active_propname, _index):
@ -609,6 +613,10 @@ class ColorAttributesListBase():
)
flags[idx] = 0 if skip else flags[idx]
# Reorder by name.
if self.use_filter_sort_alpha:
indices = bpy.types.UI_UL_list.sort_items_by_name(attributes, "name")
return flags, indices

View File

@ -89,6 +89,10 @@ class POINTCLOUD_UL_attributes(UIList):
for idx, item in enumerate(attributes):
flags[idx] = 0 if item.is_internal else flags[idx]
# Reorder by name.
if self.use_filter_sort_alpha:
indices = bpy.types.UI_UL_list.sort_items_by_name(attributes, "name")
return flags, indices
def draw_item(self, _context, layout, _data, attribute, _icon, _active_data, _active_propname, _index):