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:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-01-19 00:51:26 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-01-19 00:51:26 +0400
commit7771f0fee3e508674b4852d0ae1f3ae01243ade8 (patch)
treee79c31704cc43b873b735bc05f65e4866bcd6a2a /mesh_bsurfaces.py
parente837d39bd3928cf829893b4fa64100ed0e7d2256 (diff)
- Removed dots from the end of description
- Check for keymap availability to suppress warning messages when running blender in background mode
Diffstat (limited to 'mesh_bsurfaces.py')
-rw-r--r--mesh_bsurfaces.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/mesh_bsurfaces.py b/mesh_bsurfaces.py
index 07d16ea9..b51d80f5 100644
--- a/mesh_bsurfaces.py
+++ b/mesh_bsurfaces.py
@@ -822,9 +822,10 @@ def register():
bpy.types.Scene.SURFSK_keep_strokes = bpy.props.BoolProperty(name="Keep strokes", description="Keeps the sketched strokes after adding the surface", default=False)
kc = bpy.context.window_manager.keyconfigs.addon
- km = kc.keymaps.new(name="3D View", space_type="VIEW_3D")
- keymap_item_add_surf = km.keymap_items.new("gpencil.surfsk_add_surface","E","PRESS", key_modifier="D")
- keymap_item_stroke_to_curve = km.keymap_items.new("gpencil.surfsk_strokes_to_curves","C","PRESS", key_modifier="D")
+ if kc:
+ km = kc.keymaps.new(name="3D View", space_type="VIEW_3D")
+ keymap_item_add_surf = km.keymap_items.new("gpencil.surfsk_add_surface","E","PRESS", key_modifier="D")
+ keymap_item_stroke_to_curve = km.keymap_items.new("gpencil.surfsk_strokes_to_curves","C","PRESS", key_modifier="D")
def unregister():
@@ -838,15 +839,16 @@ def unregister():
del bpy.types.Scene.SURFSK_keep_strokes
kc = bpy.context.window_manager.keyconfigs.addon
- km = kc.keymaps["3D View"]
- for kmi in km.keymap_items:
- if kmi.idname == 'wm.call_menu':
- if kmi.properties.name == "GPENCIL_OT_SURFSK_add_surface":
- km.keymap_items.remove(kmi)
- elif kmi.properties.name == "GPENCIL_OT_SURFSK_strokes_to_curves":
- km.keymap_items.remove(kmi)
- else:
- continue
+ if kc:
+ km = kc.keymaps["3D View"]
+ for kmi in km.keymap_items:
+ if kmi.idname == 'wm.call_menu':
+ if kmi.properties.name == "GPENCIL_OT_SURFSK_add_surface":
+ km.keymap_items.remove(kmi)
+ elif kmi.properties.name == "GPENCIL_OT_SURFSK_strokes_to_curves":
+ km.keymap_items.remove(kmi)
+ else:
+ continue
if __name__ == "__main__":