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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-08-06 00:46:30 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-08-06 00:46:30 +0400
commit2f80c8db1172ae449d7908a4cb31d2425e5df823 (patch)
treec44a2faeaeecbdebd500221b0bd78d8d71db8a09 /mesh_bsurfaces.py
parentba7827ff27fc77a0fccfa2495b52ddfbb5744dd1 (diff)
Addon updates for keymap changes.
[[Split portion of a mixed commit.]]
Diffstat (limited to 'mesh_bsurfaces.py')
-rw-r--r--mesh_bsurfaces.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/mesh_bsurfaces.py b/mesh_bsurfaces.py
index 2bb0fc0e..40cf891c 100644
--- a/mesh_bsurfaces.py
+++ b/mesh_bsurfaces.py
@@ -828,8 +828,10 @@ def register():
bpy.types.Scene.SURFSK_precision = bpy.props.IntProperty(name="Precision", description="Precision level of the surface calculation", default=4, min=0, max=100000)
bpy.types.Scene.SURFSK_keep_strokes = bpy.props.BoolProperty(name="Keep strokes", description="Keeps the sketched strokes after adding the surface", default=False)
- keymap_item_add_surf = bpy.data.window_managers[0].keyconfigs.active.keymaps["3D View"].keymap_items.new("gpencil.surfsk_add_surface","E","PRESS", key_modifier="D")
- keymap_item_stroke_to_curve = bpy.data.window_managers[0].keyconfigs.active.keymaps["3D View"].keymap_items.new("gpencil.surfsk_strokes_to_curves","C","PRESS", key_modifier="D")
+ 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")
def unregister():
@@ -842,7 +844,8 @@ def unregister():
del bpy.types.Scene.SURFSK_precision
del bpy.types.Scene.SURFSK_keep_strokes
- km = bpy.data.window_managers[0].keyconfigs.active.keymaps["3D View"]
+ 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":