Fix #108078: Crash when inverting results in pose library sidebar

a958ae36e8 introduced support for UI lists to reference items that would
never be shown, regardless of filter settings. This was to skip assets
in the asset view template that were not of the requested type. UI list
sorting code wasn't updated to account for such items that should be
entirely ignored.

Pull Request: https://projects.blender.org/blender/blender/pulls/109157
This commit is contained in:
Julian Eisel
2024-03-22 12:25:39 +01:00
parent 365f5f8823
commit 303014bfac
6 changed files with 38 additions and 18 deletions

View File

@@ -136,8 +136,9 @@ class MESH_UL_vgroups_slow(bpy.types.UIList):
def filter_items(self, context, data, propname):
# This function gets the collection property (as the usual tuple (data, propname)), and must return two lists:
# * The first one is for filtering, it must contain 32bit integers were self.bitflag_filter_item marks the
# matching item as filtered (i.e. to be shown), and 31 other bits are free for custom needs. Here we use the
# first one to mark VGROUP_EMPTY.
# matching item as filtered (i.e. to be shown). The upper 16 bits (including self.bitflag_filter_item) are
# reserved for internal use, the lower 16 bits are free for custom use. Here we use the first bit to mark
# VGROUP_EMPTY.
# * The second one is for reordering, it must return a list containing the new indices of the items (which
# gives us a mapping org_idx -> new_idx).
# Please note that the default UI_UL_list defines helper functions for common tasks (see its doc for more info).