From b1ef55abdbb9f47712049748ccf65d009c059160 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Tue, 9 Mar 2021 17:24:49 +0100 Subject: 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. --- source/blender/makesrna/intern/rna_wm_api.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'source') 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", ""); -- cgit v1.2.3