Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'space_view3d_materials_utils.py')
-rw-r--r--space_view3d_materials_utils.py9
1 files changed, 3 insertions, 6 deletions
diff --git a/space_view3d_materials_utils.py b/space_view3d_materials_utils.py
index 2b3bb2d0..a0e43316 100644
--- a/space_view3d_materials_utils.py
+++ b/space_view3d_materials_utils.py
@@ -686,18 +686,15 @@ class VIEW3D_MT_select_material(bpy.types.Menu):
def register():
bpy.utils.register_module(__name__)
- kc = bpy.data.window_managers[0].keyconfigs.default
- km = kc.keymaps.get("3D View")
- if km is None:
- km = kc.keymaps.new(name="3D View")
-
+ kc = bpy.context.window_manager.keyconfigs.addon
+ km = kc.keymaps.new(name="3D View", space_type="VIEW_3D")
kmi = km.keymap_items.new('wm.call_menu', 'Q', 'PRESS')
kmi.properties.name = "VIEW3D_MT_master_material"
def unregister():
bpy.utils.unregister_module(__name__)
- kc = bpy.data.window_managers[0].keyconfigs.default
+ kc = bpy.context.window_manager.keyconfigs.addon
km = kc.keymaps["3D View"]
for kmi in km.keymap_items:
if kmi.idname == 'wm.call_menu':