Created
October 4, 2012 18:55
-
-
Save zeffii/3835647 to your computer and use it in GitHub Desktop.
scripted keymapping
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# script to map 1, 2, 3 to vertex, edge, face selection for 3dview | |
import bpy | |
wm = bpy.context.window_manager | |
if True: | |
deactivate_list = ['ONE', 'TWO', 'THREE'] | |
view3d_km_items = wm.keyconfigs.default.keymaps['3D View'].keymap_items | |
for j in view3d_km_items: | |
if j.type in deactivate_list and j.name == 'Layers': | |
j.active = False | |
if True: | |
my_keymap = { 'ONE': "True, False, False", | |
'TWO': "False, True, False", | |
'THREE': "False, False, True"} | |
km = wm.keyconfigs.default.keymaps['Mesh'] | |
for k, v in my_keymap.items(): | |
new_shortcut = km.keymap_items.new('wm.context_set_value', k, 'PRESS') | |
new_shortcut.properties.data_path = 'tool_settings.mesh_select_mode' | |
new_shortcut.properties.value = v | |
print('complete') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment