Use the same data format and loader that the default key-maps use.
This supports nested properties (needed for macros)
and fixes modal key-maps which weren't supported.
This format still needs to be documented.
bpy_extras were meant to be useful high-level helper functions for
script authors to perform common operations,
to avoid writing to verbose API's.
bpy_extras.keymap_utils contains some specialized API calls
mainly intended for Blender's own internal use.
Move keymap import export to internal API.
Currently the filenames are used when setting keymaps.
This hard coded naming meant the preset and setting function
need to be kept in sync.
Prefer to not have hard coded replacements which need to be duplicated.
For Blender builtin configurations the option to choose the select mouse remains
and is now also in the splash screen. It works by changing the keymap dynamically
in the script, rather than using special events.
The system of automatic switching of events was not flexible enough to deal with
side effects that require further keymap changes, so it is now under more manual
control in the script.
This breaks compatibility for some scripts and exported key configurations.
These can be fixed by replacing SELECTMOUSE, ACTIONMOUSE, EVT_TWEAK_S and
EVT_TWEAK_A with appropriate LEFTMOUSE, RIGHTMOUSE, EVT_TWEAK_L and
EVT_TWEAK_R events.
Other than that, there should be no functional changes.
This refactors loading of key configurations to clear and refill existing
ones, rather than adding a new one and then removing the old one.
This fixes broken loading of non-default configurations after recent changes,
and prepares for future changes to make it possible to dynamically change
key configurations based on user preferences.
Review wasn't finished yet, but I just commit this for now so that I can make some progress..
Differential Revision: https://developer.blender.org/D3901
This should be purely an implementation change,
for end users there should be no functional difference.
The entire key configuration is in one file with ~5000 lines of code.
Mostly avoiding code duplication and preserve comments and utility
functions from the C code.
It's a bit long but for searching and editing it's also convenient to
have it all in one file.
Notes:
- Actual keymap is shared by blender / blender_legacy
and stored in `keymap_data/blender_default.py`
This only generates JSON-like data to be passed into
`keyconfig_import_from_data`, allowing other presets to load and
manipulate the default keymap.
- Each preset defines 'keyconfig_data'
which can be shared between presets.
- Some of the utility functions for generating keymap items still
need to be ported over to Python.
- Some keymap items can be made into loops (marked as TODO).
See: D3907
RNA's ViewLayer would present 'first level' of layer collection as a
list (collection property), when it is actually now only a single item,
same as the scene's master collection.
Note: did not try to update view_layer python tests, those are already
fully broken for quiet some time I guess (they still assume
view_layer.collections to be mutable e.g.)...