Exported key configuration set is not sorted #75355

Closed
opened 2020-04-03 18:35:49 +02:00 by Roman Kornev · 12 comments

System Information
Operating system: Win10 x64
Graphics card: GTX 1080Ti

Blender Version
Broken: 2.82a
Worked: (newest version of Blender that worked as expected)

Short description of error
Easy fix.
Right now, the exported key configuration set is NOT sorted. Which makes it extremely difficult to compare different key sets, because the order constantly changes.
A simple piece of code like sorted(keyconfig_data) before exporting should do the trick.
Since the order of items in that file has no effect on importing, I see no downside to this.

Exact steps for others to reproduce the error
Open any keymap
Click Export
The exported list is not alphabetically sorted by the first tuple value.

**System Information** Operating system: Win10 x64 Graphics card: GTX 1080Ti **Blender Version** Broken: 2.82a Worked: (newest version of Blender that worked as expected) **Short description of error** Easy fix. Right now, the exported key configuration set is NOT sorted. Which makes it extremely difficult to compare different key sets, because the order constantly changes. A simple piece of code like `sorted(keyconfig_data)` before exporting should do the trick. Since the order of items in that file has no effect on importing, I see no downside to this. **Exact steps for others to reproduce the error** Open any keymap Click Export The exported list is not alphabetically sorted by the first tuple value.
Author

Added subscriber: @RomanKornev

Added subscriber: @RomanKornev
Member

Added subscriber: @ankitm

Added subscriber: @ankitm
Member
https://developer.blender.org/diffusion/B/browse/master/release/scripts/modules/bl_keymap_utils/io.py$131
Author

Looking at current issues in https://developer.blender.org/T68884:

The ability to re-order key-map items.

This is important as key-map items are handled in the order listed, with some items passing on to key-map items defined afterwards.

If key-map items are handled in order without the ability to change that order in the UI, then we can't quite sort everything.
But we can sort the top-level groups like 'Window', 'Screen', '3D View' between each other, since they will never conflict, but their order is still random currently.

I've implemented the change locally, and the performance impact is non-existant on my machine, because the top-level list has only about 200 items.

Looking at current issues in https://developer.blender.org/T68884: > The ability to re-order key-map items. > > This is important as key-map items are handled in the order listed, with some items passing on to key-map items defined afterwards. If key-map items are handled in order without the ability to change that order in the UI, then we can't quite sort everything. But we can sort the top-level groups like 'Window', 'Screen', '3D View' between each other, since they will never conflict, but their order is still random currently. I've implemented the change locally, and the performance impact is non-existant on my machine, because the top-level list has only about 200 items.
Member
you may submit a patch though. https://developer.blender.org/differential/diff/create/
Author

Thanks! I'm still learning how to contribute.

Thanks! I'm still learning how to contribute.

Added subscriber: @iss

Added subscriber: @iss
I will also add https://wiki.blender.org/wiki/Process/Contributing_Code
Author

I submitted the patch.

I submitted the patch.

Added subscriber: @ideasman42

Added subscriber: @ideasman42

Changed status from 'Needs Triage' to: 'Resolved'

Changed status from 'Needs Triage' to: 'Resolved'
Campbell Barton self-assigned this 2020-04-06 15:42:24 +02:00

Committed D7350, closing.

Committed [D7350](https://archive.blender.org/developer/D7350), closing.
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#75355
No description provided.