This commit is contained in:
OOOO 2023-07-28 23:37:40 +00:00
parent 0c7df24fc7
commit d9e7b3fe93

View File

@ -13,24 +13,100 @@ def kmi_props_setattr(kmi_props, attr, value):
wm = bpy.context.window_manager
kc = wm.keyconfigs.new(os.path.splitext(os.path.basename(__file__))[0])
# Map View2D Buttons List
km = kc.keymaps.new('View2D Buttons List', space_type='EMPTY', region_type='WINDOW', modal=False)
# Map Screen
km = kc.keymaps.new('Screen', space_type='EMPTY', region_type='WINDOW', modal=False)
kmi = km.keymap_items.new('view2d.scroller_activate', 'LEFTMOUSE', 'PRESS')
kmi = km.keymap_items.new('view2d.scroller_activate', 'MIDDLEMOUSE', 'PRESS')
kmi = km.keymap_items.new('view2d.pan', 'MIDDLEMOUSE', 'PRESS')
kmi = km.keymap_items.new('view2d.pan', 'TRACKPADPAN', 'ANY')
kmi = km.keymap_items.new('view2d.scroll_down', 'WHEELDOWNMOUSE', 'PRESS')
kmi = km.keymap_items.new('view2d.scroll_up', 'WHEELUPMOUSE', 'PRESS')
kmi = km.keymap_items.new('view2d.scroll_down', 'PAGE_DOWN', 'PRESS')
kmi_props_setattr(kmi.properties, 'page', True)
kmi = km.keymap_items.new('view2d.scroll_up', 'PAGE_UP', 'PRESS')
kmi_props_setattr(kmi.properties, 'page', True)
kmi = km.keymap_items.new('view2d.zoom', 'MIDDLEMOUSE', 'ANY', shift=True)
kmi = km.keymap_items.new('view2d.zoom', 'MIDDLEMOUSE', 'ANY', shift=True)
kmi = km.keymap_items.new('view2d.zoom_out', 'NUMPAD_MINUS', 'PRESS')
kmi = km.keymap_items.new('view2d.zoom_in', 'NUMPAD_PLUS', 'PRESS')
kmi = km.keymap_items.new('view2d.reset', 'HOME', 'PRESS')
kmi = km.keymap_items.new('pillar.browser', 'A', 'PRESS', shift=True, ctrl=True, alt=True)
kmi = km.keymap_items.new('pillar.browser', 'A', 'PRESS', shift=True, ctrl=True, alt=True)
kmi = km.keymap_items.new('pillar.browser', 'A', 'PRESS', shift=True, ctrl=True, alt=True)
kmi = km.keymap_items.new('pillar.browser', 'A', 'PRESS', shift=True, ctrl=True, alt=True)
kmi = km.keymap_items.new('screen.animation_step', 'TIMER0', 'ANY', any=True)
kmi = km.keymap_items.new('screen.region_blend', 'TIMERREGION', 'ANY', any=True)
kmi = km.keymap_items.new('screen.screen_set', 'RIGHT_ARROW', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'delta', 1)
kmi = km.keymap_items.new('screen.screen_set', 'LEFT_ARROW', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'delta', -1)
kmi = km.keymap_items.new('screen.screen_full_area', 'UP_ARROW', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('screen.screen_full_area', 'DOWN_ARROW', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('screen.screen_full_area', 'SPACE', 'PRESS', shift=True)
kmi = km.keymap_items.new('screen.screen_full_area', 'F10', 'PRESS', alt=True)
kmi_props_setattr(kmi.properties, 'use_hide_panels', True)
kmi = km.keymap_items.new('screen.screenshot', 'F3', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('screen.screencast', 'F3', 'PRESS', alt=True)
kmi = km.keymap_items.new('screen.space_context_cycle', 'TAB', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'direction', 'NEXT')
kmi = km.keymap_items.new('screen.space_context_cycle', 'TAB', 'PRESS', shift=True, ctrl=True)
kmi_props_setattr(kmi.properties, 'direction', 'PREV')
kmi = km.keymap_items.new('screen.region_quadview', 'Q', 'PRESS', ctrl=True, alt=True)
kmi = km.keymap_items.new('screen.repeat_history', 'F3', 'PRESS')
kmi = km.keymap_items.new('screen.repeat_last', 'R', 'PRESS', shift=True)
kmi = km.keymap_items.new('screen.region_flip', 'F5', 'PRESS')
kmi = km.keymap_items.new('screen.redo_last', 'F6', 'PRESS')
kmi = km.keymap_items.new('script.reload', 'F8', 'PRESS')
kmi = km.keymap_items.new('file.execute', 'RET', 'PRESS')
kmi = km.keymap_items.new('file.execute', 'NUMPAD_ENTER', 'PRESS')
kmi = km.keymap_items.new('file.cancel', 'ESC', 'PRESS')
kmi = km.keymap_items.new('ed.undo', 'Z', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('ed.redo', 'Z', 'PRESS', shift=True, ctrl=True)
kmi = km.keymap_items.new('ed.undo_history', 'Z', 'PRESS', ctrl=True, alt=True)
kmi = km.keymap_items.new('render.render', 'F12', 'PRESS', alt=True)
kmi_props_setattr(kmi.properties, 'use_viewport', True)
kmi = km.keymap_items.new('render.render', 'F12', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'animation', True)
kmi_props_setattr(kmi.properties, 'use_viewport', True)
kmi = km.keymap_items.new('render.view_cancel', 'ESC', 'PRESS')
kmi = km.keymap_items.new('render.view_show', 'F11', 'PRESS')
kmi = km.keymap_items.new('render.play_rendered_anim', 'F11', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('screen.userpref_show', 'U', 'PRESS', shift=True, alt=True)
kmi = km.keymap_items.new('none', 'A', 'PRESS')
kmi = km.keymap_items.new('none', 'A', 'PRESS')
kmi = km.keymap_items.new('render.opengl', 'F12', 'PRESS')
# Map Frames
km = kc.keymaps.new('Frames', space_type='EMPTY', region_type='WINDOW', modal=False)
kmi = km.keymap_items.new('screen.frame_offset', 'UP_ARROW', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'delta', 10)
kmi = km.keymap_items.new('screen.frame_offset', 'DOWN_ARROW', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'delta', -10)
kmi = km.keymap_items.new('screen.frame_offset', 'LEFT_ARROW', 'PRESS')
kmi_props_setattr(kmi.properties, 'delta', -1)
kmi = km.keymap_items.new('screen.frame_offset', 'RIGHT_ARROW', 'PRESS')
kmi_props_setattr(kmi.properties, 'delta', 1)
kmi = km.keymap_items.new('screen.frame_offset', 'WHEELDOWNMOUSE', 'PRESS', alt=True)
kmi_props_setattr(kmi.properties, 'delta', 1)
kmi = km.keymap_items.new('screen.frame_offset', 'WHEELUPMOUSE', 'PRESS', alt=True)
kmi_props_setattr(kmi.properties, 'delta', -1)
kmi = km.keymap_items.new('screen.frame_jump', 'UP_ARROW', 'PRESS', shift=True, ctrl=True)
kmi_props_setattr(kmi.properties, 'end', True)
kmi = km.keymap_items.new('screen.frame_jump', 'DOWN_ARROW', 'PRESS', shift=True, ctrl=True)
kmi_props_setattr(kmi.properties, 'end', False)
kmi = km.keymap_items.new('screen.frame_jump', 'RIGHT_ARROW', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'end', True)
kmi = km.keymap_items.new('screen.frame_jump', 'LEFT_ARROW', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'end', False)
kmi = km.keymap_items.new('screen.keyframe_jump', 'UP_ARROW', 'PRESS')
kmi_props_setattr(kmi.properties, 'next', True)
kmi = km.keymap_items.new('screen.keyframe_jump', 'DOWN_ARROW', 'PRESS')
kmi_props_setattr(kmi.properties, 'next', False)
kmi = km.keymap_items.new('screen.keyframe_jump', 'MEDIA_LAST', 'PRESS')
kmi_props_setattr(kmi.properties, 'next', True)
kmi = km.keymap_items.new('screen.keyframe_jump', 'MEDIA_FIRST', 'PRESS')
kmi_props_setattr(kmi.properties, 'next', False)
kmi = km.keymap_items.new('screen.animation_play', 'SPACE', 'PRESS')
kmi = km.keymap_items.new('screen.animation_play', 'A', 'PRESS', shift=True, alt=True)
kmi_props_setattr(kmi.properties, 'reverse', True)
kmi = km.keymap_items.new('screen.animation_cancel', 'ESC', 'PRESS')
kmi = km.keymap_items.new('screen.animation_play', 'MEDIA_PLAY', 'PRESS')
kmi = km.keymap_items.new('screen.animation_cancel', 'MEDIA_STOP', 'PRESS')
# Map 3D View Generic
km = kc.keymaps.new('3D View Generic', space_type='VIEW_3D', region_type='WINDOW', modal=False)
kmi = km.keymap_items.new('view3d.properties', 'N', 'PRESS')
kmi = km.keymap_items.new('view3d.toolshelf', 'T', 'PRESS')
kmi = km.keymap_items.new('cycles.preview_pause', 'PAUSE', 'PRESS')
kmi = km.keymap_items.new('cycles.preview_pause', 'PAUSE', 'PRESS')
# Map Object Non-modal
km = kc.keymaps.new('Object Non-modal', space_type='EMPTY', region_type='WINDOW', modal=False)
@ -49,6 +125,16 @@ kmi = km.keymap_items.new('object.origin_set', 'C', 'PRESS', shift=True, ctrl=Tr
# Map 3D View
km = kc.keymaps.new('3D View', space_type='VIEW_3D', region_type='WINDOW', modal=False)
kmi = km.keymap_items.new('wm.call_menu', 'Q', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_master_material')
kmi = km.keymap_items.new('wm.call_menu', 'Q', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_master_material')
kmi = km.keymap_items.new('wm.call_menu', 'Q', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_master_material')
kmi = km.keymap_items.new('wm.call_menu', 'Q', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_master_material')
kmi = km.keymap_items.new('wm.call_menu', 'Q', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_master_material')
kmi = km.keymap_items.new('wm.call_menu', 'Q', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'name', 'VIEW3D_MT_master_material')
kmi = km.keymap_items.new('wm.call_menu', 'Q', 'PRESS', shift=True)
@ -70,8 +156,9 @@ kmi_props_setattr(kmi.properties, 'release_confirm', True)
kmi_props_setattr(kmi.properties, 'use_accurate', False)
kmi_props_setattr(kmi.properties, 'use_planar_constraint', False)
kmi = km.keymap_items.new('view3d.cursor3d', 'ACTIONMOUSE', 'PRESS')
kmi = km.keymap_items.new('view3d.move', 'MIDDLEMOUSE', 'ANY', ctrl=True)
kmi = km.keymap_items.new('view3d.dolly', 'MIDDLEMOUSE', 'PRESS', shift=True, alt=True)
kmi = km.keymap_items.new('view3d.rotate', 'MIDDLEMOUSE', 'PRESS', alt=True)
kmi = km.keymap_items.new('view3d.zoom', 'MIDDLEMOUSE', 'PRESS', shift=True)
kmi = km.keymap_items.new('view3d.dolly', 'MIDDLEMOUSE', 'PRESS', shift=True, ctrl=True)
kmi = km.keymap_items.new('view3d.view_selected', 'NUMPAD_PERIOD', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'use_all_regions', True)
kmi = km.keymap_items.new('view3d.view_selected', 'NUMPAD_PERIOD', 'PRESS')
@ -80,7 +167,11 @@ kmi = km.keymap_items.new('view3d.view_lock_to_active', 'NUMPAD_PERIOD', 'PRESS'
kmi = km.keymap_items.new('view3d.view_lock_clear', 'NUMPAD_PERIOD', 'PRESS', alt=True)
kmi = km.keymap_items.new('view3d.navigate', 'F', 'PRESS', shift=True)
kmi = km.keymap_items.new('view3d.smoothview', 'TIMER1', 'ANY', any=True)
kmi = km.keymap_items.new('view3d.move', 'MIDDLEMOUSE', 'ANY', ctrl=True)
kmi = km.keymap_items.new('view3d.rotate', 'TRACKPADPAN', 'ANY')
kmi = km.keymap_items.new('view3d.rotate', 'MOUSEROTATE', 'ANY')
kmi = km.keymap_items.new('view3d.move', 'MIDDLEMOUSE', 'PRESS')
kmi = km.keymap_items.new('view3d.zoom', 'TRACKPADZOOM', 'ANY')
kmi = km.keymap_items.new('view3d.zoom', 'TRACKPADPAN', 'ANY', ctrl=True)
kmi = km.keymap_items.new('view3d.zoom', 'NUMPAD_PLUS', 'PRESS')
kmi_props_setattr(kmi.properties, 'delta', 1)
kmi = km.keymap_items.new('view3d.zoom', 'NUMPAD_MINUS', 'PRESS')
@ -136,6 +227,14 @@ kmi = km.keymap_items.new('view3d.viewnumpad', 'NUMPAD_3', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'type', 'LEFT')
kmi = km.keymap_items.new('view3d.viewnumpad', 'NUMPAD_7', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'type', 'BOTTOM')
kmi = km.keymap_items.new('view3d.view_pan', 'NUMPAD_2', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'type', 'PANDOWN')
kmi = km.keymap_items.new('view3d.view_pan', 'NUMPAD_4', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'type', 'PANLEFT')
kmi = km.keymap_items.new('view3d.view_pan', 'NUMPAD_6', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'type', 'PANRIGHT')
kmi = km.keymap_items.new('view3d.view_pan', 'NUMPAD_8', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'type', 'PANUP')
kmi = km.keymap_items.new('view3d.view_roll', 'NUMPAD_4', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'type', 'LEFT')
kmi = km.keymap_items.new('view3d.view_roll', 'NUMPAD_6', 'PRESS', shift=True)
@ -143,6 +242,14 @@ kmi_props_setattr(kmi.properties, 'type', 'RIGHT')
kmi = km.keymap_items.new('view3d.view_orbit', 'NUMPAD_9', 'PRESS')
kmi_props_setattr(kmi.properties, 'angle', 3.1415927410125732)
kmi_props_setattr(kmi.properties, 'type', 'ORBITRIGHT')
kmi = km.keymap_items.new('view3d.view_pan', 'WHEELUPMOUSE', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'type', 'PANRIGHT')
kmi = km.keymap_items.new('view3d.view_pan', 'WHEELDOWNMOUSE', 'PRESS', ctrl=True)
kmi_props_setattr(kmi.properties, 'type', 'PANLEFT')
kmi = km.keymap_items.new('view3d.view_pan', 'WHEELUPMOUSE', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'type', 'PANUP')
kmi = km.keymap_items.new('view3d.view_pan', 'WHEELDOWNMOUSE', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'type', 'PANDOWN')
kmi = km.keymap_items.new('view3d.view_orbit', 'WHEELUPMOUSE', 'PRESS', ctrl=True, alt=True)
kmi_props_setattr(kmi.properties, 'type', 'ORBITLEFT')
kmi = km.keymap_items.new('view3d.view_orbit', 'WHEELDOWNMOUSE', 'PRESS', ctrl=True, alt=True)
@ -176,6 +283,7 @@ kmi_props_setattr(kmi.properties, 'align_active', True)
kmi = km.keymap_items.new('view3d.localview', 'NUMPAD_SLASH', 'PRESS')
kmi = km.keymap_items.new('view3d.ndof_orbit_zoom', 'NDOF_MOTION', 'ANY')
kmi = km.keymap_items.new('view3d.ndof_orbit', 'NDOF_MOTION', 'ANY', ctrl=True)
kmi = km.keymap_items.new('view3d.ndof_pan', 'NDOF_MOTION', 'ANY', shift=True)
kmi = km.keymap_items.new('view3d.ndof_all', 'NDOF_MOTION', 'ANY', shift=True, ctrl=True)
kmi = km.keymap_items.new('view3d.view_selected', 'NDOF_BUTTON_FIT', 'PRESS')
kmi_props_setattr(kmi.properties, 'use_all_regions', False)
@ -204,6 +312,8 @@ kmi_props_setattr(kmi.properties, 'align_active', True)
kmi = km.keymap_items.new('view3d.viewnumpad', 'NDOF_BUTTON_TOP', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'type', 'TOP')
kmi_props_setattr(kmi.properties, 'align_active', True)
kmi = km.keymap_items.new('view3d.layers', 'ACCENT_GRAVE', 'PRESS')
kmi_props_setattr(kmi.properties, 'nr', 0)
kmi = km.keymap_items.new('view3d.layers', 'ONE', 'PRESS', any=True)
kmi_props_setattr(kmi.properties, 'nr', 1)
kmi = km.keymap_items.new('view3d.layers', 'TWO', 'PRESS', any=True)
@ -340,12 +450,33 @@ kmi_props_setattr(kmi.properties, 'use', True)
kmi = km.keymap_items.new('transform.mirror', 'M', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('wm.context_toggle', 'TAB', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.use_snap')
kmi = km.keymap_items.new('wm.context_menu_enum', 'TAB', 'PRESS', shift=True, ctrl=True)
kmi_props_setattr(kmi.properties, 'data_path', 'tool_settings.snap_element')
kmi = km.keymap_items.new('transform.translate', 'T', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'texture_space', True)
kmi = km.keymap_items.new('transform.resize', 'T', 'PRESS', shift=True, alt=True)
kmi_props_setattr(kmi.properties, 'texture_space', True)
kmi = km.keymap_items.new('transform.skin_resize', 'A', 'PRESS', ctrl=True)
# Map View2D Buttons List
km = kc.keymaps.new('View2D Buttons List', space_type='EMPTY', region_type='WINDOW', modal=False)
kmi = km.keymap_items.new('view2d.scroller_activate', 'LEFTMOUSE', 'PRESS')
kmi = km.keymap_items.new('view2d.scroller_activate', 'MIDDLEMOUSE', 'PRESS')
kmi = km.keymap_items.new('view2d.pan', 'MIDDLEMOUSE', 'PRESS')
kmi = km.keymap_items.new('view2d.pan', 'TRACKPADPAN', 'ANY')
kmi = km.keymap_items.new('view2d.scroll_down', 'WHEELDOWNMOUSE', 'PRESS')
kmi = km.keymap_items.new('view2d.scroll_up', 'WHEELUPMOUSE', 'PRESS')
kmi = km.keymap_items.new('view2d.scroll_down', 'PAGE_DOWN', 'PRESS')
kmi_props_setattr(kmi.properties, 'page', True)
kmi = km.keymap_items.new('view2d.scroll_up', 'PAGE_UP', 'PRESS')
kmi_props_setattr(kmi.properties, 'page', True)
kmi = km.keymap_items.new('view2d.zoom', 'MIDDLEMOUSE', 'ANY', shift=True)
kmi = km.keymap_items.new('view2d.zoom', 'MIDDLEMOUSE', 'ANY', shift=True)
kmi = km.keymap_items.new('view2d.zoom_out', 'NUMPAD_MINUS', 'PRESS')
kmi = km.keymap_items.new('view2d.zoom_in', 'NUMPAD_PLUS', 'PRESS')
kmi = km.keymap_items.new('view2d.reset', 'HOME', 'PRESS')
# Map Image
km = kc.keymaps.new('Image', space_type='IMAGE_EDITOR', region_type='WINDOW', modal=False)
@ -353,7 +484,7 @@ kmi = km.keymap_items.new('image.view_all', 'HOME', 'PRESS')
kmi = km.keymap_items.new('image.view_all', 'HOME', 'PRESS', shift=True)
kmi_props_setattr(kmi.properties, 'fit_view', True)
kmi = km.keymap_items.new('image.view_selected', 'NUMPAD_PERIOD', 'PRESS')
kmi = km.keymap_items.new('image.view_pan', 'MIDDLEMOUSE', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('image.view_pan', 'MIDDLEMOUSE', 'PRESS')
kmi = km.keymap_items.new('image.view_pan', 'TRACKPADPAN', 'ANY')
kmi = km.keymap_items.new('image.view_all', 'NDOF_BUTTON_FIT', 'PRESS')
kmi = km.keymap_items.new('image.view_ndof', 'NDOF_MOTION', 'ANY')
@ -556,8 +687,7 @@ km = kc.keymaps.new('View2D', space_type='EMPTY', region_type='WINDOW', modal=Fa
kmi = km.keymap_items.new('view2d.scroller_activate', 'LEFTMOUSE', 'PRESS')
kmi = km.keymap_items.new('view2d.scroller_activate', 'MIDDLEMOUSE', 'PRESS')
kmi = km.keymap_items.new('view2d.pan', 'MIDDLEMOUSE', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('view2d.pan', 'MIDDLEMOUSE', 'ANY')
kmi = km.keymap_items.new('view2d.pan', 'MIDDLEMOUSE', 'PRESS')
kmi = km.keymap_items.new('view2d.scroll_right', 'WHEELDOWNMOUSE', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('view2d.scroll_left', 'WHEELUPMOUSE', 'PRESS', ctrl=True)
kmi = km.keymap_items.new('view2d.scroll_down', 'WHEELDOWNMOUSE', 'PRESS', shift=True)
@ -572,5 +702,6 @@ kmi = km.keymap_items.new('view2d.scroll_down', 'WHEELDOWNMOUSE', 'PRESS')
kmi = km.keymap_items.new('view2d.scroll_up', 'WHEELUPMOUSE', 'PRESS')
kmi = km.keymap_items.new('view2d.scroll_right', 'WHEELDOWNMOUSE', 'PRESS')
kmi = km.keymap_items.new('view2d.scroll_left', 'WHEELUPMOUSE', 'PRESS')
kmi = km.keymap_items.new('view2d.zoom', 'MIDDLEMOUSE', 'ANY', shift=True)
kmi = km.keymap_items.new('view2d.zoom_border', 'B', 'PRESS', shift=True)