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:
authorBastien Montagne <montagne29@wanadoo.fr>2014-08-20 11:29:18 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2014-08-20 11:41:08 +0400
commitc24bd5bb2f56043b6d988c42f426d46c80799def (patch)
tree259fab91d349f9e13e9098ad370275e77065cf69 /mesh_f2.py
parentdcb4b78b1b743ac5dde9a67b6efdb94acc108991 (diff)
Fix T41500: mesh_f2.py annoying exception when running blender from terminal with '--background --python'
keyconfigs are not available in background mode...
Diffstat (limited to 'mesh_f2.py')
-rw-r--r--mesh_f2.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/mesh_f2.py b/mesh_f2.py
index 16f67b95..61786d10 100644
--- a/mesh_f2.py
+++ b/mesh_f2.py
@@ -384,10 +384,11 @@ def register():
bpy.utils.register_class(c)
# add keymap entry
- km = bpy.context.window_manager.keyconfigs.addon.keymaps.new(\
- name='Mesh', space_type='EMPTY')
- kmi = km.keymap_items.new("mesh.f2", 'F', 'PRESS')
- addon_keymaps.append((km, kmi))
+ kcfg = bpy.context.window_manager.keyconfigs.addon
+ if kcfg:
+ km = kcfg.keymaps.new(name='Mesh', space_type='EMPTY')
+ kmi = km.keymap_items.new("mesh.f2", 'F', 'PRESS')
+ addon_keymaps.append((km, kmi))
def unregister():