Page MenuHome

UIList filter_items doesn't reorder properly
Closed, ArchivedPublic

Description

System Information
Operating system: Windows 10
Graphics card: GTX 970m

Blender Version
Broken: 2.80, a5b5bd2c24e0, branch: blender2.7, 2019-05-14
Worked: (optional)

UIList.filter_items does not reorder items correctly for most cases.

Exact steps for others to reproduce the error


Just open this blend file and run the script.
The scenes should be in order ['Scene.002', 'Scene', 'Scene.001', 'Scene.003', 'Scene.004'], but they are not.

Or make a custom UIList and set some weird item order inside UIList.filter_items

Event Timeline

Bastien Montagne (mont29) changed the task status from Unknown Status to Archived.May 15 2019, 4:54 PM
Bastien Montagne (mont29) claimed this task.

This is working exactly as expected, in your example first item is moved to third place, second item is moved to first place, third to second, etc. Again, this is a mapping (from index in array to value in array) old_idx -> new_idx. Not a mapping new_idx -> old_idx...