diff options
author | Sybren A. Stüvel <sybren@blender.org> | 2021-03-09 19:24:49 +0300 |
---|---|---|
committer | Sybren A. Stüvel <sybren@blender.org> | 2021-03-09 19:42:23 +0300 |
commit | b1ef55abdbb9f47712049748ccf65d009c059160 (patch) | |
tree | fb81272b561f815f1f1c11e43e9b5e68f8325b72 /source/blender/makesrna/intern/rna_wm_api.c | |
parent | 8351e2d4b94c601bcf1984a2c92ccfaa2a2601fa (diff) |
Cleanup: Document `ensure()`-like behaviour of `KeyMaps.new()`
Document the fact that `bpy.types.KeyMaps.new()` will not create a new
keymap but instead return an existing one, if one with the given
name/space/region already exists.
No functional changes.
Diffstat (limited to 'source/blender/makesrna/intern/rna_wm_api.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_wm_api.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c index cb20b480ee5..e7ca41bb5be 100644 --- a/source/blender/makesrna/intern/rna_wm_api.c +++ b/source/blender/makesrna/intern/rna_wm_api.c @@ -1216,6 +1216,11 @@ void RNA_api_keymaps(StructRNA *srna) func = RNA_def_function(srna, "new", "rna_keymap_new"); /* add_keymap */ RNA_def_function_flag(func, FUNC_USE_REPORTS); + RNA_def_function_ui_description( + func, + "Ensure the keymap exists. This will return the one with the given name/space type/region " + "type, or create a new one if it does not exist yet."); + parm = RNA_def_string(func, "name", NULL, 0, "Name", ""); RNA_def_parameter_flags(parm, 0, PARM_REQUIRED); RNA_def_enum(func, "space_type", rna_enum_space_type_items, SPACE_EMPTY, "Space Type", ""); |