diff --git a/release/scripts/ui/space_userpref_keymap.py b/release/scripts/ui/space_userpref_keymap.py index 4b54a09c096..bab087b946a 100644 --- a/release/scripts/ui/space_userpref_keymap.py +++ b/release/scripts/ui/space_userpref_keymap.py @@ -714,7 +714,7 @@ class WM_OT_keyitem_restore(bpy.types.Operator): def execute(self, context): wm = context.manager km = context.keymap - kmi = km.item_from_id(self.properties.item_id) + kmi = km.items.from_id(self.properties.item_id) km.restore_item_to_default(kmi) @@ -755,7 +755,7 @@ class WM_OT_keyitem_remove(bpy.types.Operator): def execute(self, context): wm = context.manager km = context.keymap - kmi = km.item_from_id(self.properties.item_id) + kmi = km.items.from_id(self.properties.item_id) km.items.remove(kmi) return {'FINISHED'} diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 231ca01fe25..14c71e3cd95 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -1406,6 +1406,13 @@ static void rna_def_keymap_items(BlenderRNA *brna, PropertyRNA *cprop) func= RNA_def_function(srna, "remove", "WM_keymap_remove_item"); parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", ""); RNA_def_property_flag(parm, PROP_REQUIRED); + + func= RNA_def_function(srna, "from_id", "WM_keymap_item_find_id"); + parm= RNA_def_property(func, "id", PROP_INT, PROP_NONE); + RNA_def_property_flag(parm, PROP_REQUIRED); + RNA_def_property_ui_text(parm, "id", "ID of the item"); + parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", ""); + RNA_def_function_return(func, parm); } diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c index 5f1e8f65f43..b13d7627a34 100644 --- a/source/blender/makesrna/intern/rna_wm_api.c +++ b/source/blender/makesrna/intern/rna_wm_api.c @@ -238,13 +238,6 @@ void RNA_api_keymap(StructRNA *srna) parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Active key map."); RNA_def_function_return(func, parm); - func= RNA_def_function(srna, "item_from_id", "WM_keymap_item_find_id"); - parm= RNA_def_property(func, "id", PROP_INT, PROP_NONE); - RNA_def_property_flag(parm, PROP_REQUIRED); - RNA_def_property_ui_text(parm, "id", "ID of the item"); - parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", ""); - RNA_def_function_return(func, parm); - func= RNA_def_function(srna, "copy_to_user", "WM_keymap_copy_to_user"); parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "User editable key map."); RNA_def_function_return(func, parm);