WIP: UI: Operator to Save Custom Keymap #120043

Draft
Harley Acheson wants to merge 1 commits from Harley/blender:SaveKeymap into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Member

An operator for saving custom keymaps. Include a poll to only enable
it when a custom keymap is selected. Shows a confirmation.


New keymap configurations can be easily created in Blender: Edit / Preferences / Keymap, Presets, "+" button. This prompts for a name and then creates a new keymap file in your profile.

However...

How do you update that custom keymap file after you make changes? Very unintuitively, you click on that "+" again, enter the name of your keymap (exactly), then click "OK". In a nutshell you create a new keymap with the same name and therefore overwrite the old file with the new.

This PR allows you to just click a "Save" button.

Disabled for built-in keymaps:

image

Enabled for custom keymaps:

image

Confirmation:

image

This is mostly here so that @JulianEisel and @HooglyBoogly can take a look at how this might not work well here like the equivalent can for Themes.

For example lets play with the first thing on the list, Window / New File, which is by default assigned to Ctrl-N.

  • Click the "+" and make new theme, call it "Test"
  • With "Test" the selected keymap, change "New File" to something like "F1"
  • Click the "Save" Button.
  • You now have a Test.py file in your profile, seems to contain everything in the "Window" section.
  • Change the preset to "Blender".
  • You see that "New File" is showing as F1 too. That's not right.
  • Click "Restore" and the Blender keymap is now showing Ctrl-N for "New File". So fixed.
  • Change to "Test" and see that is still showing F1 so everything seems fine now.

So you can get this to work, but there is that weird hiccup in the middle.

An operator for saving custom keymaps. Include a poll to only enable it when a custom keymap is selected. Shows a confirmation. --- New keymap configurations can be easily created in Blender: Edit / Preferences / Keymap, Presets, "+" button. This prompts for a name and then creates a new keymap file in your profile. However... How do you update that custom keymap file after you make changes? Very unintuitively, you click on that "+" again, enter the name of your keymap (exactly), then click "OK". In a nutshell you create a new keymap with the same name and therefore overwrite the old file with the new. This PR allows you to just click a "Save" button. Disabled for built-in keymaps: ![image](/attachments/e8d5dbd2-8498-4d2f-8c23-a68440e2a58f) Enabled for custom keymaps: ![image](/attachments/c22822b3-375e-4f9d-b6c1-14f8b1031153) Confirmation: ![image](/attachments/11c72dfd-83bb-4e7e-89dd-5270df2c1954) This is mostly here so that @JulianEisel and @HooglyBoogly can take a look at how this might not work well here like the equivalent can for Themes. For example lets play with the first thing on the list, Window / New File, which is by default assigned to Ctrl-N. * Click the "+" and make new theme, call it "Test" * With "Test" the selected keymap, change "New File" to something like "F1" * Click the "Save" Button. * You now have a Test.py file in your profile, seems to contain everything in the "Window" section. * Change the preset to "Blender". * You see that "New File" is showing as F1 too. That's not right. * Click "Restore" and the Blender keymap is now showing Ctrl-N for "New File". So fixed. * Change to "Test" and see that is still showing F1 so everything seems fine now. So you can get this to work, but there is that weird hiccup in the middle.
Harley Acheson added 1 commit 2024-03-29 01:18:12 +01:00
8bcdcabfd9 WIP: UI: Operator to Save Custom Keymap
An operator for saving custom keymaps. Include a poll to only enable
it when a custom keymap is selected.
Harley Acheson added this to the User Interface project 2024-03-29 01:18:57 +01:00
This pull request is marked as a work in progress.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u SaveKeymap:Harley-SaveKeymap
git checkout Harley-SaveKeymap
Sign in to join this conversation.
No reviewers
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
1 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#120043
No description provided.