diff options
-rw-r--r-- | release/scripts/io/export_fbx.py | 4 | ||||
-rw-r--r-- | release/scripts/presets/interaction/maya.py | 442 | ||||
-rw-r--r-- | release/scripts/ui/space_userpref_keymap.py | 37 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_ops.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_action.c | 13 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_action_api.c | 26 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_scene.c | 2 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_wm.c | 106 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_wm_api.c | 66 | ||||
-rw-r--r-- | source/blender/windowmanager/WM_api.h | 4 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm.c | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_keymap.c | 6 |
12 files changed, 352 insertions, 360 deletions
diff --git a/release/scripts/io/export_fbx.py b/release/scripts/io/export_fbx.py index a86dec24778..7c95b7efd52 100644 --- a/release/scripts/io/export_fbx.py +++ b/release/scripts/io/export_fbx.py @@ -2760,7 +2760,9 @@ Takes: {''') else: file.write('\n\tTake: "%s" {' % sane_takename(blenAction)) - act_start, act_end = blenAction.get_frame_range() + act_start, act_end = blenAction.frame_range + act_start = int(act_start) + act_end = int(act_end) # tmp = blenAction.getFrameNumbers() # if tmp: # act_start = min(tmp) diff --git a/release/scripts/presets/interaction/maya.py b/release/scripts/presets/interaction/maya.py index 7f5b6e8c79c..6c8d09f7b81 100644 --- a/release/scripts/presets/interaction/maya.py +++ b/release/scripts/presets/interaction/maya.py @@ -2,377 +2,377 @@ import bpy wm = bpy.context.manager -kc = wm.add_keyconfig('Maya') +kc = wm.keyconfigs.new('Maya') # Map 3D View -km = kc.add_keymap('3D View', space_type='VIEW_3D', region_type='WINDOW', modal=False) +km = kc.keymaps.new('3D View', space_type='VIEW_3D', region_type='WINDOW', modal=False) -kmi = km.items.add('view3d.manipulator', 'LEFTMOUSE', 'PRESS', any=True) +kmi = km.items.new('view3d.manipulator', 'LEFTMOUSE', 'PRESS', any=True) kmi.properties.release_confirm = True -kmi = km.items.add('view3d.cursor3d', 'ACTIONMOUSE', 'PRESS') -kmi = km.items.add('view3d.rotate', 'LEFTMOUSE', 'PRESS', alt=True) -kmi = km.items.add('view3d.move', 'MIDDLEMOUSE', 'PRESS', alt=True) -kmi = km.items.add('view3d.zoom', 'RIGHTMOUSE', 'PRESS', alt=True) -kmi = km.items.add('view3d.view_selected', 'NUMPAD_PERIOD', 'PRESS') -kmi = km.items.add('view3d.view_center_cursor', 'NUMPAD_PERIOD', 'PRESS', ctrl=True) -kmi = km.items.add('view3d.fly', 'F', 'PRESS', shift=True) -kmi = km.items.add('view3d.smoothview', 'TIMER1', 'ANY', any=True) -kmi = km.items.add('view3d.rotate', 'TRACKPADPAN', 'ANY', alt=True) -kmi = km.items.add('view3d.rotate', 'MOUSEROTATE', 'ANY') -kmi = km.items.add('view3d.move', 'TRACKPADPAN', 'ANY') -kmi = km.items.add('view3d.zoom', 'TRACKPADZOOM', 'ANY') -kmi = km.items.add('view3d.zoom', 'NUMPAD_PLUS', 'PRESS') +kmi = km.items.new('view3d.cursor3d', 'ACTIONMOUSE', 'PRESS') +kmi = km.items.new('view3d.rotate', 'LEFTMOUSE', 'PRESS', alt=True) +kmi = km.items.new('view3d.move', 'MIDDLEMOUSE', 'PRESS', alt=True) +kmi = km.items.new('view3d.zoom', 'RIGHTMOUSE', 'PRESS', alt=True) +kmi = km.items.new('view3d.view_selected', 'NUMPAD_PERIOD', 'PRESS') +kmi = km.items.new('view3d.view_center_cursor', 'NUMPAD_PERIOD', 'PRESS', ctrl=True) +kmi = km.items.new('view3d.fly', 'F', 'PRESS', shift=True) +kmi = km.items.new('view3d.smoothview', 'TIMER1', 'ANY', any=True) +kmi = km.items.new('view3d.rotate', 'TRACKPADPAN', 'ANY', alt=True) +kmi = km.items.new('view3d.rotate', 'MOUSEROTATE', 'ANY') +kmi = km.items.new('view3d.move', 'TRACKPADPAN', 'ANY') +kmi = km.items.new('view3d.zoom', 'TRACKPADZOOM', 'ANY') +kmi = km.items.new('view3d.zoom', 'NUMPAD_PLUS', 'PRESS') kmi.properties.delta = 1 -kmi = km.items.add('view3d.zoom', 'NUMPAD_MINUS', 'PRESS') +kmi = km.items.new('view3d.zoom', 'NUMPAD_MINUS', 'PRESS') kmi.properties.delta = -1 -kmi = km.items.add('view3d.zoom', 'EQUAL', 'PRESS', ctrl=True) +kmi = km.items.new('view3d.zoom', 'EQUAL', 'PRESS', ctrl=True) kmi.properties.delta = 1 -kmi = km.items.add('view3d.zoom', 'MINUS', 'PRESS', ctrl=True) +kmi = km.items.new('view3d.zoom', 'MINUS', 'PRESS', ctrl=True) kmi.properties.delta = -1 -kmi = km.items.add('view3d.zoom', 'WHEELINMOUSE', 'PRESS') +kmi = km.items.new('view3d.zoom', 'WHEELINMOUSE', 'PRESS') kmi.properties.delta = 1 -kmi = km.items.add('view3d.zoom', 'WHEELOUTMOUSE', 'PRESS') +kmi = km.items.new('view3d.zoom', 'WHEELOUTMOUSE', 'PRESS') kmi.properties.delta = -1 -kmi = km.items.add('view3d.view_all', 'HOME', 'PRESS') +kmi = km.items.new('view3d.view_all', 'HOME', 'PRESS') kmi.properties.center = False -kmi = km.items.add('view3d.view_all', 'C', 'PRESS', shift=True) +kmi = km.items.new('view3d.view_all', 'C', 'PRESS', shift=True) kmi.properties.center = True -kmi = km.items.add('view3d.viewnumpad', 'NUMPAD_0', 'PRESS') +kmi = km.items.new('view3d.viewnumpad', 'NUMPAD_0', 'PRESS') kmi.properties.type = 'CAMERA' -kmi = km.items.add('view3d.viewnumpad', 'NUMPAD_1', 'PRESS') +kmi = km.items.new('view3d.viewnumpad', 'NUMPAD_1', 'PRESS') kmi.properties.type = 'FRONT' -kmi = km.items.add('view3d.view_orbit', 'NUMPAD_2', 'PRESS') +kmi = km.items.new('view3d.view_orbit', 'NUMPAD_2', 'PRESS') kmi.properties.type = 'ORBITDOWN' -kmi = km.items.add('view3d.viewnumpad', 'NUMPAD_3', 'PRESS') +kmi = km.items.new('view3d.viewnumpad', 'NUMPAD_3', 'PRESS') kmi.properties.type = 'RIGHT' -kmi = km.items.add('view3d.view_orbit', 'NUMPAD_4', 'PRESS') +kmi = km.items.new('view3d.view_orbit', 'NUMPAD_4', 'PRESS') kmi.properties.type = 'ORBITLEFT' -kmi = km.items.add('view3d.view_persportho', 'NUMPAD_5', 'PRESS') -kmi = km.items.add('view3d.view_orbit', 'NUMPAD_6', 'PRESS') +kmi = km.items.new('view3d.view_persportho', 'NUMPAD_5', 'PRESS') +kmi = km.items.new('view3d.view_orbit', 'NUMPAD_6', 'PRESS') kmi.properties.type = 'ORBITRIGHT' -kmi = km.items.add('view3d.viewnumpad', 'NUMPAD_7', 'PRESS') +kmi = km.items.new('view3d.viewnumpad', 'NUMPAD_7', 'PRESS') kmi.properties.type = 'TOP' -kmi = km.items.add('view3d.view_orbit', 'NUMPAD_8', 'PRESS') +kmi = km.items.new('view3d.view_orbit', 'NUMPAD_8', 'PRESS') kmi.properties.type = 'ORBITUP' -kmi = km.items.add('view3d.viewnumpad', 'NUMPAD_1', 'PRESS', ctrl=True) +kmi = km.items.new('view3d.viewnumpad', 'NUMPAD_1', 'PRESS', ctrl=True) kmi.properties.type = 'BACK' -kmi = km.items.add('view3d.viewnumpad', 'NUMPAD_3', 'PRESS', ctrl=True) +kmi = km.items.new('view3d.viewnumpad', 'NUMPAD_3', 'PRESS', ctrl=True) kmi.properties.type = 'LEFT' -kmi = km.items.add('view3d.viewnumpad', 'NUMPAD_7', 'PRESS', ctrl=True) +kmi = km.items.new('view3d.viewnumpad', 'NUMPAD_7', 'PRESS', ctrl=True) kmi.properties.type = 'BOTTOM' -kmi = km.items.add('view3d.view_pan', 'NUMPAD_2', 'PRESS', ctrl=True) +kmi = km.items.new('view3d.view_pan', 'NUMPAD_2', 'PRESS', ctrl=True) kmi.properties.type = 'PANDOWN' -kmi = km.items.add('view3d.view_pan', 'NUMPAD_4', 'PRESS', ctrl=True) +kmi = km.items.new('view3d.view_pan', 'NUMPAD_4', 'PRESS', ctrl=True) kmi.properties.type = 'PANLEFT' -kmi = km.items.add('view3d.view_pan', 'NUMPAD_6', 'PRESS', ctrl=True) +kmi = km.items.new('view3d.view_pan', 'NUMPAD_6', 'PRESS', ctrl=True) kmi.properties.type = 'PANRIGHT' -kmi = km.items.add('view3d.view_pan', 'NUMPAD_8', 'PRESS', ctrl=True) +kmi = km.items.new('view3d.view_pan', 'NUMPAD_8', 'PRESS', ctrl=True) kmi.properties.type = 'PANUP' -kmi = km.items.add('view3d.view_pan', 'WHEELUPMOUSE', 'PRESS', ctrl=True) +kmi = km.items.new('view3d.view_pan', 'WHEELUPMOUSE', 'PRESS', ctrl=True) kmi.properties.type = 'PANRIGHT' -kmi = km.items.add('view3d.view_pan', 'WHEELDOWNMOUSE', 'PRESS', ctrl=True) +kmi = km.items.new('view3d.view_pan', 'WHEELDOWNMOUSE', 'PRESS', ctrl=True) kmi.properties.type = 'PANLEFT' -kmi = km.items.add('view3d.view_pan', 'WHEELUPMOUSE', 'PRESS', shift=True) +kmi = km.items.new('view3d.view_pan', 'WHEELUPMOUSE', 'PRESS', shift=True) kmi.properties.type = 'PANUP' -kmi = km.items.add('view3d.view_pan', 'WHEELDOWNMOUSE', 'PRESS', shift=True) +kmi = km.items.new('view3d.view_pan', 'WHEELDOWNMOUSE', 'PRESS', shift=True) kmi.properties.type = 'PANDOWN' -kmi = km.items.add('view3d.view_orbit', 'WHEELUPMOUSE', 'PRESS', ctrl=True, alt=True) +kmi = km.items.new('view3d.view_orbit', 'WHEELUPMOUSE', 'PRESS', ctrl=True, alt=True) kmi.properties.type = 'ORBITLEFT' -kmi = km.items.add('view3d.view_orbit', 'WHEELDOWNMOUSE', 'PRESS', ctrl=True, alt=True) +kmi = km.items.new('view3d.view_orbit', 'WHEELDOWNMOUSE', 'PRESS', ctrl=True, alt=True) kmi.properties.type = 'ORBITRIGHT' -kmi = km.items.add('view3d.view_orbit', 'WHEELUPMOUSE', 'PRESS', shift=True, alt=True) +kmi = km.items.new('view3d.view_orbit', 'WHEELUPMOUSE', 'PRESS', shift=True, alt=True) kmi.properties.type = 'ORBITUP' -kmi = km.items.add('view3d.view_orbit', 'WHEELDOWNMOUSE', 'PRESS', shift=True, alt=True) +kmi = km.items.new('view3d.view_orbit', 'WHEELDOWNMOUSE', 'PRESS', shift=True, alt=True) kmi.properties.type = 'ORBITDOWN' -kmi = km.items.add('view3d.viewnumpad', 'NUMPAD_1', 'PRESS', shift=True) +kmi = km.items.new('view3d.viewnumpad', 'NUMPAD_1', 'PRESS', shift=True) kmi.properties.align_active = True kmi.properties.type = 'FRONT' -kmi = km.items.add('view3d.viewnumpad', 'NUMPAD_3', 'PRESS', shift=True) +kmi = km.items.new('view3d.viewnumpad', 'NUMPAD_3', 'PRESS', shift=True) kmi.properties.align_active = True kmi.properties.type = 'RIGHT' -kmi = km.items.add('view3d.viewnumpad', 'NUMPAD_7', 'PRESS', shift=True) +kmi = km.items.new('view3d.viewnumpad', 'NUMPAD_7', 'PRESS', shift=True) kmi.properties.align_active = True kmi.properties.type = 'TOP' -kmi = km.items.add('view3d.viewnumpad', 'NUMPAD_1', 'PRESS', shift=True, ctrl=True) +kmi = km.items.new('view3d.viewnumpad', 'NUMPAD_1', 'PRESS', shift=True, ctrl=True) kmi.properties.align_active = True kmi.properties.type = 'BACK' -kmi = km.items.add('view3d.viewnumpad', 'NUMPAD_3', 'PRESS', shift=True, ctrl=True) +kmi = km.items.new('view3d.viewnumpad', 'NUMPAD_3', 'PRESS', shift=True, ctrl=True) kmi.properties.align_active = True kmi.properties.type = 'LEFT' -kmi = km.items.add('view3d.viewnumpad', 'NUMPAD_7', 'PRESS', shift=True, ctrl=True) +kmi = km.items.new('view3d.viewnumpad', 'NUMPAD_7', 'PRESS', shift=True, ctrl=True) kmi.properties.align_active = True kmi.properties.type = 'BOTTOM' -kmi = km.items.add('view3d.localview', 'NUMPAD_SLASH', 'PRESS') -kmi = km.items.add('view3d.layers', 'ACCENT_GRAVE', 'PRESS') +kmi = km.items.new('view3d.localview', 'NUMPAD_SLASH', 'PRESS') +kmi = km.items.new('view3d.layers', 'ACCENT_GRAVE', 'PRESS') kmi.properties.nr = 0 -kmi = km.items.add('view3d.layers', 'ONE', 'PRESS', any=True) +kmi = km.items.new('view3d.layers', 'ONE', 'PRESS', any=True) kmi.properties.nr = 1 -kmi = km.items.add('view3d.layers', 'TWO', 'PRESS', any=True) +kmi = km.items.new('view3d.layers', 'TWO', 'PRESS', any=True) kmi.properties.nr = 2 -kmi = km.items.add('view3d.layers', 'THREE', 'PRESS', any=True) +kmi = km.items.new('view3d.layers', 'THREE', 'PRESS', any=True) kmi.properties.nr = 3 -kmi = km.items.add('view3d.layers', 'FOUR', 'PRESS', any=True) +kmi = km.items.new('view3d.layers', 'FOUR', 'PRESS', any=True) kmi.properties.nr = 4 -kmi = km.items.add('view3d.layers', 'FIVE', 'PRESS', any=True) +kmi = km.items.new('view3d.layers', 'FIVE', 'PRESS', any=True) kmi.properties.nr = 5 -kmi = km.items.add('view3d.layers', 'SIX', 'PRESS', any=True) +kmi = km.items.new('view3d.layers', 'SIX', 'PRESS', any=True) kmi.properties.nr = 6 -kmi = km.items.add('view3d.layers', 'SEVEN', 'PRESS', any=True) +kmi = km.items.new('view3d.layers', 'SEVEN', 'PRESS', any=True) kmi.properties.nr = 7 -kmi = km.items.add('view3d.layers', 'EIGHT', 'PRESS', any=True) +kmi = km.items.new('view3d.layers', 'EIGHT', 'PRESS', any=True) kmi.properties.nr = 8 -kmi = km.items.add('view3d.layers', 'NINE', 'PRESS', any=True) +kmi = km.items.new('view3d.layers', 'NINE', 'PRESS', any=True) kmi.properties.nr = 9 -kmi = km.items.add('view3d.layers', 'ZERO', 'PRESS', any=True) +kmi = km.items.new('view3d.layers', 'ZERO', 'PRESS', any=True) kmi.properties.nr = 10 -kmi = km.items.add('wm.context_toggle_enum', 'Z', 'PRESS') +kmi = km.items.new('wm.context_toggle_enum', 'Z', 'PRESS') kmi.properties.data_path = 'space_data.viewport_shade' kmi.properties.value_1 = 'SOLID' kmi.properties.value_2 = 'WIREFRAME' -kmi = km.items.add('wm.context_toggle_enum', 'Z', 'PRESS', alt=True) +kmi = km.items.new('wm.context_toggle_enum', 'Z', 'PRESS', alt=True) kmi.properties.data_path = 'space_data.viewport_shade' kmi.properties.value_1 = 'TEXTURED' kmi.properties.value_2 = 'SOLID' -kmi = km.items.add('view3d.select', 'SELECTMOUSE', 'PRESS') -kmi = km.items.add('view3d.select', 'SELECTMOUSE', 'PRESS', shift=True) +kmi = km.items.new('view3d.select', 'SELECTMOUSE', 'PRESS') +kmi = km.items.new('view3d.select', 'SELECTMOUSE', 'PRESS', shift=True) kmi.properties.extend = True -kmi = km.items.add('view3d.select', 'SELECTMOUSE', 'PRESS', ctrl=True) +kmi = km.items.new('view3d.select', 'SELECTMOUSE', 'PRESS', ctrl=True) kmi.properties.center = True -kmi = km.items.add('view3d.select', 'SELECTMOUSE', 'PRESS', alt=True) +kmi = km.items.new('view3d.select', 'SELECTMOUSE', 'PRESS', alt=True) kmi.properties.enumerate = True -kmi = km.items.add('view3d.select', 'SELECTMOUSE', 'PRESS', shift=True, ctrl=True) +kmi = km.items.new('view3d.select', 'SELECTMOUSE', 'PRESS', shift=True, ctrl=True) kmi.properties.center = True kmi.properties.extend = True -kmi = km.items.add('view3d.select', 'SELECTMOUSE', 'PRESS', ctrl=True, alt=True) +kmi = km.items.new('view3d.select', 'SELECTMOUSE', 'PRESS', ctrl=True, alt=True) kmi.properties.center = True kmi.properties.enumerate = True -kmi = km.items.add('view3d.select', 'SELECTMOUSE', 'PRESS', shift=True, alt=True) +kmi = km.items.new('view3d.select', 'SELECTMOUSE', 'PRESS', shift=True, alt=True) kmi.properties.enumerate = True kmi.properties.extend = True -kmi = km.items.add('view3d.select', 'SELECTMOUSE', 'PRESS', shift=True, ctrl=True, alt=True) +kmi = km.items.new('view3d.select', 'SELECTMOUSE', 'PRESS', shift=True, ctrl=True, alt=True) kmi.properties.center = True kmi.properties.enumerate = True kmi.properties.extend = True -kmi = km.items.add('view3d.select_border', 'EVT_TWEAK_S', 'ANY') +kmi = km.items.new('view3d.select_border', 'EVT_TWEAK_S', 'ANY') kmi.properties.extend = False -kmi = km.items.add('view3d.select_lasso', 'EVT_TWEAK_A', 'ANY', ctrl=True) -kmi = km.items.add('view3d.select_lasso', 'EVT_TWEAK_A', 'ANY', shift=True, ctrl=True) +kmi = km.items.new('view3d.select_lasso', 'EVT_TWEAK_A', 'ANY', ctrl=True) +kmi = km.items.new('view3d.select_lasso', 'EVT_TWEAK_A', 'ANY', shift=True, ctrl=True) kmi.properties.deselect = True -kmi = km.items.add('view3d.select_circle', 'C', 'PRESS') -kmi = km.items.add('view3d.clip_border', 'B', 'PRESS', alt=True) -kmi = km.items.add('view3d.zoom_border', 'B', 'PRESS', shift=True) -kmi = km.items.add('view3d.render_border', 'B', 'PRESS', shift=True) -kmi = km.items.add('view3d.camera_to_view', 'NUMPAD_0', 'PRESS', ctrl=True, alt=True) -kmi = km.items.add('view3d.object_as_camera', 'NUMPAD_0', 'PRESS', ctrl=True) -kmi = km.items.add('wm.call_menu', 'S', 'PRESS', shift=True) +kmi = km.items.new('view3d.select_circle', 'C', 'PRESS') +kmi = km.items.new('view3d.clip_border', 'B', 'PRESS', alt=True) +kmi = km.items.new('view3d.zoom_border', 'B', 'PRESS', shift=True) +kmi = km.items.new('view3d.render_border', 'B', 'PRESS', shift=True) +kmi = km.items.new('view3d.camera_to_view', 'NUMPAD_0', 'PRESS', ctrl=True, alt=True) +kmi = km.items.new('view3d.object_as_camera', 'NUMPAD_0', 'PRESS', ctrl=True) +kmi = km.items.new('wm.call_menu', 'S', 'PRESS', shift=True) kmi.properties.name = 'VIEW3D_MT_snap' -kmi = km.items.add('wm.context_set_enum', 'COMMA', 'PRESS') +kmi = km.items.new('wm.context_set_enum', 'COMMA', 'PRESS') kmi.properties.data_path = 'space_data.pivot_point' kmi.properties.value = 'BOUNDING_BOX_CENTER' -kmi = km.items.add('wm.context_set_enum', 'COMMA', 'PRESS', ctrl=True) +kmi = km.items.new('wm.context_set_enum', 'COMMA', 'PRESS', ctrl=True) kmi.properties.data_path = 'space_data.pivot_point' kmi.properties.value = 'MEDIAN_POINT' -kmi = km.items.add('wm.context_toggle', 'COMMA', 'PRESS', alt=True) +kmi = km.items.new('wm.context_toggle', 'COMMA', 'PRESS', alt=True) kmi.properties.data_path = 'space_data.use_pivot_point_align' -kmi = km.items.add('wm.context_toggle', 'Q', 'PRESS') +kmi = km.items.new('wm.context_toggle', 'Q', 'PRESS') kmi.properties.data_path = 'space_data.show_manipulator' -kmi = km.items.add('wm.context_set_enum', 'PERIOD', 'PRESS') +kmi = km.items.new('wm.context_set_enum', 'PERIOD', 'PRESS') kmi.properties.data_path = 'space_data.pivot_point' kmi.properties.value = 'CURSOR' -kmi = km.items.add('wm.context_set_enum', 'PERIOD', 'PRESS', ctrl=True) +kmi = km.items.new('wm.context_set_enum', 'PERIOD', 'PRESS', ctrl=True) kmi.properties.data_path = 'space_data.pivot_point' kmi.properties.value = 'INDIVIDUAL_ORIGINS' -kmi = km.items.add('wm.context_set_enum', 'PERIOD', 'PRESS', alt=True) +kmi = km.items.new('wm.context_set_enum', 'PERIOD', 'PRESS', alt=True) kmi.properties.data_path = 'space_data.pivot_point' kmi.properties.value = 'ACTIVE_ELEMENT' -kmi = km.items.add('transform.translate', 'G', 'PRESS', shift=True) -kmi = km.items.add('transform.translate', 'EVT_TWEAK_S', 'ANY') -kmi = km.items.add('transform.rotate', 'R', 'PRESS', shift=True) -kmi = km.items.add('transform.resize', 'S', 'PRESS', shift=True) -kmi = km.items.add('transform.warp', 'W', 'PRESS', shift=True) -kmi = km.items.add('transform.tosphere', 'S', 'PRESS', shift=True, alt=True) -kmi = km.items.add('transform.shear', 'S', 'PRESS', shift=True, ctrl=True, alt=True) -kmi = km.items.add('transform.select_orientation', 'SPACE', 'PRESS', alt=True) -kmi = km.items.add('transform.create_orientation', 'SPACE', 'PRESS', ctrl=True, alt=True) +kmi = km.items.new('transform.translate', 'G', 'PRESS', shift=True) +kmi = km.items.new('transform.translate', 'EVT_TWEAK_S', 'ANY') +kmi = km.items.new('transform.rotate', 'R', 'PRESS', shift=True) +kmi = km.items.new('transform.resize', 'S', 'PRESS', shift=True) +kmi = km.items.new('transform.warp', 'W', 'PRESS', shift=True) +kmi = km.items.new('transform.tosphere', 'S', 'PRESS', shift=True, alt=True) +kmi = km.items.new('transform.shear', 'S', 'PRESS', shift=True, ctrl=True, alt=True) +kmi = km.items.new('transform.select_orientation', 'SPACE', 'PRESS', alt=True) +kmi = km.items.new('transform.create_orientation', 'SPACE', 'PRESS', ctrl=True, alt=True) kmi.properties.use = True -kmi = km.items.add('transform.mirror', 'M', 'PRESS', ctrl=True) -kmi = km.items.add('wm.context_toggle', 'TAB', 'PRESS', shift=True) +kmi = km.items.new('transform.mirror', 'M', 'PRESS', ctrl=True) +kmi = km.items.new('wm.context_toggle', 'TAB', 'PRESS', shift=True) kmi.properties.data_path = 'tool_settings.snap' -kmi = km.items.add('transform.snap_type', 'TAB', 'PRESS', shift=True, ctrl=True) -kmi = km.items.add('view3d.enable_manipulator', 'W', 'PRESS') +kmi = km.items.new('transform.snap_type', 'TAB', 'PRESS', shift=True, ctrl=True) +kmi = km.items.new('view3d.enable_manipulator', 'W', 'PRESS') kmi.properties.translate = True -kmi = km.items.add('view3d.enable_manipulator', 'E', 'PRESS') +kmi = km.items.new('view3d.enable_manipulator', 'E', 'PRESS') kmi.properties.rotate = True -kmi = km.items.add('view3d.enable_manipulator', 'R', 'PRESS') +kmi = km.items.new('view3d.enable_manipulator', 'R', 'PRESS') kmi.properties.scale = True -kmi = km.items.add('view3d.select_border', 'EVT_TWEAK_S', 'ANY', shift=True) +kmi = km.items.new('view3d.select_border', 'EVT_TWEAK_S', 'ANY', shift=True) kmi.properties.extend = True # Map Object Mode -km = kc.add_keymap('Object Mode', space_type='EMPTY', region_type='WINDOW', modal=False) +km = kc.keymaps.new('Object Mode', space_type='EMPTY', region_type='WINDOW', modal=False) -kmi = km.items.add('wm.context_cycle_enum', 'O', 'PRESS', shift=True) +kmi = km.items.new('wm.context_cycle_enum', 'O', 'PRESS', shift=True) kmi.properties.data_path = 'tool_settings.proportional_edit_falloff' -kmi = km.items.add('wm.context_toggle_enum', 'O', 'PRESS') +kmi = km.items.new('wm.context_toggle_enum', 'O', 'PRESS') kmi.properties.data_path = 'tool_settings.proportional_edit' kmi.properties.value_1 = 'DISABLED' kmi.properties.value_2 = 'ENABLED' -kmi = km.items.add('view3d.game_start', 'P', 'PRESS') -kmi = km.items.add('object.select_all', 'A', 'PRESS') -kmi = km.items.add('object.select_inverse', 'I', 'PRESS', ctrl=True) -kmi = km.items.add('object.select_linked', 'L', 'PRESS', shift=True) -kmi = km.items.add('object.select_grouped', 'G', 'PRESS', shift=True) -kmi = km.items.add('object.select_mirror', 'M', 'PRESS', shift=True, ctrl=True) -kmi = km.items.add('object.select_hierarchy', 'LEFT_BRACKET', 'PRESS') +kmi = km.items.new('view3d.game_start', 'P', 'PRESS') +kmi = km.items.new('object.select_all', 'A', 'PRESS') +kmi = km.items.new('object.select_inverse', 'I', 'PRESS', ctrl=True) +kmi = km.items.new('object.select_linked', 'L', 'PRESS', shift=True) +kmi = km.items.new('object.select_grouped', 'G', 'PRESS', shift=True) +kmi = km.items.new('object.select_mirror', 'M', 'PRESS', shift=True, ctrl=True) +kmi = km.items.new('object.select_hierarchy', 'LEFT_BRACKET', 'PRESS') kmi.properties.direction = 'PARENT' -kmi = km.items.add('object.select_hierarchy', 'LEFT_BRACKET', 'PRESS', shift=True) +kmi = km.items.new('object.select_hierarchy', 'LEFT_BRACKET', 'PRESS', shift=True) kmi.properties.direction = 'PARENT' kmi.properties.extend = True -kmi = km.items.add('object.select_hierarchy', 'RIGHT_BRACKET', 'PRESS') +kmi = km.items.new('object.select_hierarchy', 'RIGHT_BRACKET', 'PRESS') kmi.properties.direction = 'CHILD' -kmi = km.items.add('object.select_hierarchy', 'RIGHT_BRACKET', 'PRESS', shift=True) +kmi = km.items.new('object.select_hierarchy', 'RIGHT_BRACKET', 'PRESS', shift=True) kmi.properties.direction = 'CHILD' kmi.properties.extend = True -kmi = km.items.add('object.parent_set', 'P', 'PRESS', ctrl=True) -kmi = km.items.add('object.parent_no_inverse_set', 'P', 'PRESS', shift=True, ctrl=True) -kmi = km.items.add('object.parent_clear', 'P', 'PRESS', alt=True) -kmi = km.items.add('object.track_set', 'T', 'PRESS', ctrl=True) -kmi = km.items.add('object.track_clear', 'T', 'PRESS', alt=True) -kmi = km.items.add('object.constraint_add_with_targets', 'C', 'PRESS', shift=True, ctrl=True) -kmi = km.items.add('object.constraints_clear', 'C', 'PRESS', ctrl=True, alt=True) -kmi = km.items.add('object.location_clear', 'G', 'PRESS', alt=True) -kmi = km.items.add('object.rotation_clear', 'R', 'PRESS', alt=True) -kmi = km.items.add('object.scale_clear', 'S', 'PRESS', alt=True) -kmi = km.items.add('object.origin_clear', 'O', 'PRESS', alt=True) -kmi = km.items.add('object.hide_view_clear', 'H', 'PRESS', alt=True) -kmi = km.items.add('object.hide_view_set', 'H', 'PRESS') -kmi = km.items.add('object.hide_view_set', 'H', 'PRESS', shift=True) +kmi = km.items.new('object.parent_set', 'P', 'PRESS', ctrl=True) +kmi = km.items.new('object.parent_no_inverse_set', 'P', 'PRESS', shift=True, ctrl=True) +kmi = km.items.new('object.parent_clear', 'P', 'PRESS', alt=True) +kmi = km.items.new('object.track_set', 'T', 'PRESS', ctrl=True) +kmi = km.items.new('object.track_clear', 'T', 'PRESS', alt=True) +kmi = km.items.new('object.constraint_add_with_targets', 'C', 'PRESS', shift=True, ctrl=True) +kmi = km.items.new('object.constraints_clear', 'C', 'PRESS', ctrl=True, alt=True) +kmi = km.items.new('object.location_clear', 'G', 'PRESS', alt=True) +kmi = km.items.new('object.rotation_clear', 'R', 'PRESS', alt=True) +kmi = km.items.new('object.scale_clear', 'S', 'PRESS', alt=True) +kmi = km.items.new('object.origin_clear', 'O', 'PRESS', alt=True) +kmi = km.items.new('object.hide_view_clear', 'H', 'PRESS', alt=True) +kmi = km.items.new('object.hide_view_set', 'H', 'PRESS') +kmi = km.items.new('object.hide_view_set', 'H', 'PRESS', shift=True) kmi.properties.unselected = True -kmi = km.items.add('object.move_to_layer', 'M', 'PRESS') -kmi = km.items.add('object.delete', 'X', 'PRESS') -kmi = km.items.add('object.delete', 'DEL', 'PRESS') -kmi = km.items.add('wm.call_menu', 'A', 'PRESS', shift=True) +kmi = km.items.new('object.move_to_layer', 'M', 'PRESS') +kmi = km.items.new('object.delete', 'X', 'PRESS') +kmi = km.items.new('object.delete', 'DEL', 'PRESS') +kmi = km.items.new('wm.call_menu', 'A', 'PRESS', shift=True) kmi.properties.name = 'INFO_MT_add' -kmi = km.items.add('object.duplicates_make_real', 'A', 'PRESS', shift=True, ctrl=True) -kmi = km.items.add('wm.call_menu', 'A', 'PRESS', ctrl=True) +kmi = km.items.new('object.duplicates_make_real', 'A', 'PRESS', shift=True, ctrl=True) +kmi = km.items.new('wm.call_menu', 'A', 'PRESS', ctrl=True) kmi.properties.name = 'VIEW3D_MT_object_apply' -kmi = km.items.add('wm.call_menu', 'U', 'PRESS') +kmi = km.items.new('wm.call_menu', 'U', 'PRESS') kmi.properties.name = 'VIEW3D_MT_make_single_user' -kmi = km.items.add('wm.call_menu', 'L', 'PRESS', ctrl=True) +kmi = km.items.new('wm.call_menu', 'L', 'PRESS', ctrl=True) kmi.properties.name = 'VIEW3D_MT_make_links' -kmi = km.items.add('object.duplicate_move', 'D', 'PRESS', shift=True) -kmi = km.items.add('object.duplicate_move_linked', 'D', 'PRESS', alt=True) -kmi = km.items.add('object.join', 'J', 'PRESS', ctrl=True) -kmi = km.items.add('object.convert', 'C', 'PRESS', alt=True) -kmi = km.items.add('object.proxy_make', 'P', 'PRESS', ctrl=True, alt=True) -kmi = km.items.add('object.make_local', 'L', 'PRESS') -kmi = km.items.add('anim.keyframe_insert_menu', 'I', 'PRESS') -kmi = km.items.add('anim.keyframe_delete_v3d', 'I', 'PRESS', alt=True) -kmi = km.items.add('anim.keying_set_active_set', 'I', 'PRESS', shift=True, ctrl=True, alt=True) -kmi = km.items.add('group.create', 'G', 'PRESS', ctrl=True) -kmi = km.items.add('group.objects_remove', 'G', 'PRESS', ctrl=True, alt=True) -kmi = km.items.add('group.objects_add_active', 'G', 'PRESS', shift=True, ctrl=True) -kmi = km.items.add('group.objects_remove_active', 'G', 'PRESS', shift=True, alt=True) -kmi = km.items.add('wm.call_menu', 'W', 'PRESS', ctrl=True) +kmi = km.items.new('object.duplicate_move', 'D', 'PRESS', shift=True) +kmi = km.items.new('object.duplicate_move_linked', 'D', 'PRESS', alt=True) +kmi = km.items.new('object.join', 'J', 'PRESS', ctrl=True) +kmi = km.items.new('object.convert', 'C', 'PRESS', alt=True) +kmi = km.items.new('object.proxy_make', 'P', 'PRESS', ctrl=True, alt=True) +kmi = km.items.new('object.make_local', 'L', 'PRESS') +kmi = km.items.new('anim.keyframe_insert_menu', 'I', 'PRESS') +kmi = km.items.new('anim.keyframe_delete_v3d', 'I', 'PRESS', alt=True) +kmi = km.items.new('anim.keying_set_active_set', 'I', 'PRESS', shift=True, ctrl=True, alt=True) +kmi = km.items.new('group.create', 'G', 'PRESS', ctrl=True) +kmi = km.items.new('group.objects_remove', 'G', 'PRESS', ctrl=True, alt=True) +kmi = km.items.new('group.objects_add_active', 'G', 'PRESS', shift=True, ctrl=True) +kmi = km.items.new('group.objects_remove_active', 'G', 'PRESS', shift=True, alt=True) +kmi = km.items.new('wm.call_menu', 'W', 'PRESS', ctrl=True) kmi.properties.name = 'VIEW3D_MT_object_specials' -kmi = km.items.add('object.subdivision_set', 'ZERO', 'PRESS', ctrl=True) +kmi = km.items.new('object.subdivision_set', 'ZERO', 'PRESS', ctrl=True) kmi.properties.level = 0 -kmi = km.items.add('object.subdivision_set', 'ONE', 'PRESS', ctrl=True) +kmi = km.items.new('object.subdivision_set', 'ONE', 'PRESS', ctrl=True) kmi.properties.level = 1 -kmi = km.items.add('object.subdivision_set', 'TWO', 'PRESS', ctrl=True) +kmi = km.items.new('object.subdivision_set', 'TWO', 'PRESS', ctrl=True) kmi.properties.level = 2 -kmi = km.items.add('object.subdivision_set', 'THREE', 'PRESS', ctrl=True) +kmi = km.items.new('object.subdivision_set', 'THREE', 'PRESS', ctrl=True) kmi.properties.level = 3 -kmi = km.items.add('object.subdivision_set', 'FOUR', 'PRESS', ctrl=True) +kmi = km.items.new('object.subdivision_set', 'FOUR', 'PRESS', ctrl=True) kmi.properties.level = 4 -kmi = km.items.add('object.subdivision_set', 'FIVE', 'PRESS', ctrl=True) +kmi = km.items.new('object.subdivision_set', 'FIVE', 'PRESS', ctrl=True) kmi.properties.level = 5 -kmi = km.items.add('object.select_all', 'SELECTMOUSE', 'CLICK') +kmi = km.items.new('object.select_all', 'SELECTMOUSE', 'CLICK') kmi.properties.action = 'DESELECT' # Map Mesh -km = kc.add_keymap('Mesh', space_type='EMPTY', region_type='WINDOW', modal=False) +km = kc.keymaps.new('Mesh', space_type='EMPTY', region_type='WINDOW', modal=False) -kmi = km.items.add('mesh.loopcut_slide', 'R', 'PRESS', ctrl=True) -kmi = km.items.add('mesh.loop_select', 'SELECTMOUSE', 'PRESS', ctrl=True, alt=True) -kmi = km.items.add('mesh.loop_select', 'SELECTMOUSE', 'PRESS', shift=True, alt=True) +kmi = km.items.new('mesh.loopcut_slide', 'R', 'PRESS', ctrl=True) +kmi = km.items.new('mesh.loop_select', 'SELECTMOUSE', 'PRESS', ctrl=True, alt=True) +kmi = km.items.new('mesh.loop_select', 'SELECTMOUSE', 'PRESS', shift=True, alt=True) kmi.properties.extend = True -kmi = km.items.add('mesh.edgering_select', 'SELECTMOUSE', 'PRESS', ctrl=True, alt=True) -kmi = km.items.add('mesh.edgering_select', 'SELECTMOUSE', 'PRESS', shift=True, ctrl=True, alt=True) +kmi = km.items.new('mesh.edgering_select', 'SELECTMOUSE', 'PRESS', ctrl=True, alt=True) +kmi = km.items.new('mesh.edgering_select', 'SELECTMOUSE', 'PRESS', shift=True, ctrl=True, alt=True) kmi.properties.extend = True -kmi = km.items.add('mesh.select_shortest_path', 'SELECTMOUSE', 'PRESS', ctrl=True) -kmi = km.items.add('mesh.select_all', 'A', 'PRESS') -kmi = km.items.add('mesh.select_more', 'NUMPAD_PLUS', 'PRESS', ctrl=True) -kmi = km.items.add('mesh.select_less', 'NUMPAD_MINUS', 'PRESS', ctrl=True) -kmi = km.items.add('mesh.select_inverse', 'I', 'PRESS', ctrl=True) -kmi = km.items.add('mesh.select_non_manifold', 'M', 'PRESS', shift=True, ctrl=True, alt=True) -kmi = km.items.add('mesh.select_linked', 'L', 'PRESS', ctrl=True) -kmi = km.items.add('mesh.select_linked_pick', 'L', 'PRESS') -kmi = km.items.add('mesh.select_linked_pick', 'L', 'PRESS', shift=True) +kmi = km.items.new('mesh.select_shortest_path', 'SELECTMOUSE', 'PRESS', ctrl=True) +kmi = km.items.new('mesh.select_all', 'A', 'PRESS') +kmi = km.items.new('mesh.select_more', 'NUMPAD_PLUS', 'PRESS', ctrl=True) +kmi = km.items.new('mesh.select_less', 'NUMPAD_MINUS', 'PRESS', ctrl=True) +kmi = km.items.new('mesh.select_inverse', 'I', 'PRESS', ctrl=True) +kmi = km.items.new('mesh.select_non_manifold', 'M', 'PRESS', shift=True, ctrl=True, alt=True) +kmi = km.items.new('mesh.select_linked', 'L', 'PRESS', ctrl=True) +kmi = km.items.new('mesh.select_linked_pick', 'L', 'PRESS') +kmi = km.items.new('mesh.select_linked_pick', 'L', 'PRESS', shift=True) kmi.properties.deselect = True -kmi = km.items.add('mesh.faces_select_linked_flat', 'F', 'PRESS', shift=True, ctrl=True, alt=True) +kmi = km.items.new('mesh.faces_select_linked_flat', 'F', 'PRESS', shift=True, ctrl=True, alt=True) kmi.properties.sharpness = 135.0 -kmi = km.items.add('mesh.select_similar', 'G', 'PRESS', shift=True) -kmi = km.items.add('wm.call_menu', 'TAB', 'PRESS', ctrl=True) +kmi = km.items.new('mesh.select_similar', 'G', 'PRESS', shift=True) +kmi = km.items.new('wm.call_menu', 'TAB', 'PRESS', ctrl=True) kmi.properties.name = 'VIEW3D_MT_edit_mesh_selection_mode' -kmi = km.items.add('mesh.hide', 'H', 'PRESS') -kmi = km.items.add('mesh.hide', 'H', 'PRESS', shift=True) +kmi = km.items.new('mesh.hide', 'H', 'PRESS') +kmi = km.items.new('mesh.hide', 'H', 'PRESS', shift=True) kmi.properties.unselected = True -kmi = km.items.add('mesh.reveal', 'H', 'PRESS', alt=True) -kmi = km.items.add('mesh.normals_make_consistent', 'N', 'PRESS', ctrl=True) -kmi = km.items.add('mesh.normals_make_consistent', 'N', 'PRESS', shift=True, ctrl=True) +kmi = km.items.new('mesh.reveal', 'H', 'PRESS', alt=True) +kmi = km.items.new('mesh.normals_make_consistent', 'N', 'PRESS', ctrl=True) +kmi = km.items.new('mesh.normals_make_consistent', 'N', 'PRESS', shift=True, ctrl=True) kmi.properties.inside = True -kmi = km.items.add('view3d.edit_mesh_extrude_move_normal', 'E', 'PRESS', ctrl=True) -kmi = km.items.add('view3d.edit_mesh_extrude_individual_move', 'E', 'PRESS', shift=True) -kmi = km.items.add('wm.call_menu', 'E', 'PRESS', alt=True) +kmi = km.items.new('view3d.edit_mesh_extrude_move_normal', 'E', 'PRESS', ctrl=True) +kmi = km.items.new('view3d.edit_mesh_extrude_individual_move', 'E', 'PRESS', shift=True) +kmi = km.items.new('wm.call_menu', 'E', 'PRESS', alt=True) kmi.properties.name = 'VIEW3D_MT_edit_mesh_extrude' -kmi = km.items.add('mesh.spin', 'R', 'PRESS', alt=True) -kmi = km.items.add('mesh.fill', 'F', 'PRESS', alt=True) -kmi = km.items.add('mesh.beautify_fill', 'F', 'PRESS', shift=True, alt=True) -kmi = km.items.add('mesh.quads_convert_to_tris', 'T', 'PRESS', ctrl=True) -kmi = km.items.add('mesh.tris_convert_to_quads', 'J', 'PRESS', alt=True) -kmi = km.items.add('mesh.edge_flip', 'F', 'PRESS', shift=True, ctrl=True) -kmi = km.items.add('mesh.rip_move', 'V', 'PRESS') -kmi = km.items.add('mesh.merge', 'M', 'PRESS', alt=True) -kmi = km.items.add('transform.shrink_fatten', 'S', 'PRESS', ctrl=True, alt=True) -kmi = km.items.add('mesh.edge_face_add', 'F', 'PRESS') -kmi = km.items.add('mesh.duplicate_move', 'D', 'PRESS', shift=True) -kmi = km.items.add('wm.call_menu', 'A', 'PRESS', shift=True) +kmi = km.items.new('mesh.spin', 'R', 'PRESS', alt=True) +kmi = km.items.new('mesh.fill', 'F', 'PRESS', alt=True) +kmi = km.items.new('mesh.beautify_fill', 'F', 'PRESS', shift=True, alt=True) +kmi = km.items.new('mesh.quads_convert_to_tris', 'T', 'PRESS', ctrl=True) +kmi = km.items.new('mesh.tris_convert_to_quads', 'J', 'PRESS', alt=True) +kmi = km.items.new('mesh.edge_flip', 'F', 'PRESS', shift=True, ctrl=True) +kmi = km.items.new('mesh.rip_move', 'V', 'PRESS') +kmi = km.items.new('mesh.merge', 'M', 'PRESS', alt=True) +kmi = km.items.new('transform.shrink_fatten', 'S', 'PRESS', ctrl=True, alt=True) +kmi = km.items.new('mesh.edge_face_add', 'F', 'PRESS') +kmi = km.items.new('mesh.duplicate_move', 'D', 'PRESS', shift=True) +kmi = km.items.new('wm.call_menu', 'A', 'PRESS', shift=True) kmi.properties.name = 'INFO_MT_mesh_add' -kmi = km.items.add('mesh.separate', 'P', 'PRESS') -kmi = km.items.add('mesh.split', 'Y', 'PRESS') -kmi = km.items.add('mesh.dupli_extrude_cursor', 'ACTIONMOUSE', 'CLICK', ctrl=True) -kmi = km.items.add('mesh.delete', 'X', 'PRESS') -kmi = km.items.add('mesh.delete', 'DEL', 'PRESS') -kmi = km.items.add('mesh.knife_cut', 'LEFTMOUSE', 'PRESS', key_modifier='K') -kmi = km.items.add('mesh.knife_cut', 'LEFTMOUSE', 'PRESS', shift=True, key_modifier='K') +kmi = km.items.new('mesh.separate', 'P', 'PRESS') +kmi = km.items.new('mesh.split', 'Y', 'PRESS') +kmi = km.items.new('mesh.dupli_extrude_cursor', 'ACTIONMOUSE', 'CLICK', ctrl=True) +kmi = km.items.new('mesh.delete', 'X', 'PRESS') +kmi = km.items.new('mesh.delete', 'DEL', 'PRESS') +kmi = km.items.new('mesh.knife_cut', 'LEFTMOUSE', 'PRESS', key_modifier='K') +kmi = km.items.new('mesh.knife_cut', 'LEFTMOUSE', 'PRESS', shift=True, key_modifier='K') kmi.properties.type = 'MIDPOINTS' -kmi = km.items.add('object.vertex_parent_set', 'P', 'PRESS', ctrl=True) -kmi = km.items.add('wm.call_menu', 'W', 'PRESS', ctrl=True) +kmi = km.items.new('object.vertex_parent_set', 'P', 'PRESS', ctrl=True) +kmi = km.items.new('wm.call_menu', 'W', 'PRESS', ctrl=True) kmi.properties.name = 'VIEW3D_MT_edit_mesh_specials' -kmi = km.items.add('wm.call_menu', 'F', 'PRESS', ctrl=True) +kmi = km.items.new('wm.call_menu', 'F', 'PRESS', ctrl=True) kmi.properties.name = 'VIEW3D_MT_edit_mesh_faces' -kmi = km.items.add('wm.call_menu', 'E', 'PRESS', ctrl=True) +kmi = km.items.new('wm.call_menu', 'E', 'PRESS', ctrl=True) kmi.properties.name = 'VIEW3D_MT_edit_mesh_edges' -kmi = km.items.add('wm.call_menu', 'V', 'PRESS', ctrl=True) +kmi = km.items.new('wm.call_menu', 'V', 'PRESS', ctrl=True) kmi.properties.name = 'VIEW3D_MT_edit_mesh_vertices' -kmi = km.items.add('wm.call_menu', 'H', 'PRESS', ctrl=True) +kmi = km.items.new('wm.call_menu', 'H', 'PRESS', ctrl=True) kmi.properties.name = 'VIEW3D_MT_hook' -kmi = km.items.add('wm.call_menu', 'U', 'PRESS') +kmi = km.items.new('wm.call_menu', 'U', 'PRESS') kmi.properties.name = 'VIEW3D_MT_uv_map' -kmi = km.items.add('wm.call_menu', 'G', 'PRESS', ctrl=True) +kmi = km.items.new('wm.call_menu', 'G', 'PRESS', ctrl=True) kmi.properties.name = 'VIEW3D_MT_vertex_group' -kmi = km.items.add('wm.context_cycle_enum', 'O', 'PRESS', shift=True) +kmi = km.items.new('wm.context_cycle_enum', 'O', 'PRESS', shift=True) kmi.properties.data_path = 'tool_settings.proportional_edit_falloff' -kmi = km.items.add('wm.context_toggle_enum', 'O', 'PRESS') +kmi = km.items.new('wm.context_toggle_enum', 'O', 'PRESS') kmi.properties.data_path = 'tool_settings.proportional_edit' kmi.properties.value_1 = 'DISABLED' kmi.properties.value_2 = 'ENABLED' -kmi = km.items.add('wm.context_toggle_enum', 'O', 'PRESS', alt=True) +kmi = km.items.new('wm.context_toggle_enum', 'O', 'PRESS', alt=True) kmi.properties.data_path = 'tool_settings.proportional_edit' kmi.properties.value_1 = 'DISABLED' kmi.properties.value_2 = 'CONNECTED' -kmi = km.items.add('mesh.select_all', 'SELECTMOUSE', 'CLICK') +kmi = km.items.new('mesh.select_all', 'SELECTMOUSE', 'CLICK') kmi.properties.action = 'DESELECT' wm.keyconfigs.active = kc diff --git a/release/scripts/ui/space_userpref_keymap.py b/release/scripts/ui/space_userpref_keymap.py index 6805646ded4..4b54a09c096 100644 --- a/release/scripts/ui/space_userpref_keymap.py +++ b/release/scripts/ui/space_userpref_keymap.py @@ -138,10 +138,10 @@ class InputKeyMapPanel(bpy.types.Panel): self.draw_km(display_keymaps, kc, km, children, col, level) ''' - km = kc.find_keymap(idname, space_type=spaceid, region_type=regionid) + km = kc.keymaps.find(idname, space_type=spaceid, region_type=regionid) if not km: kc = defkc - km = kc.find_keymap(idname, space_type=spaceid, region_type=regionid) + km = kc.keymaps.find(idname, space_type=spaceid, region_type=regionid) if km: self.draw_km(kc, km, children, col, level) @@ -312,7 +312,7 @@ class InputKeyMapPanel(bpy.types.Panel): # Modal key maps attached to this operator if not km.is_modal: - kmm = kc.find_keymap_modal(kmi.idname) + kmm = kc.keymaps.find_modal(kmi.idname) if kmm: self.draw_km(display_keymaps, kc, kmm, None, layout, level + 1) layout.set_context_pointer("keymap", km) @@ -386,7 +386,8 @@ def export_properties(prefix, properties, lines=None): if lines is None: lines = [] - for value, pname in properties.items(): + for pname, value in properties.items(): + print() if not properties.is_property_hidden(pname): if isinstance(value, bpy.types.OperatorProperties): export_properties(prefix + "." + pname, value, lines) @@ -407,9 +408,9 @@ class WM_OT_keyconfig_test(bpy.types.Operator): def kmistr(kmi): if km.is_modal: - s = ["kmi = km.items.add_modal(\'%s\', \'%s\', \'%s\'" % (kmi.propvalue, kmi.type, kmi.value)] + s = ["kmi = km.items.new_modal(\'%s\', \'%s\', \'%s\'" % (kmi.propvalue, kmi.type, kmi.value)] else: - s = ["kmi = km.items.add(\'%s\', \'%s\', \'%s\'" % (kmi.idname, kmi.type, kmi.value)] + s = ["kmi = km.items.new(\'%s\', \'%s\', \'%s\'" % (kmi.idname, kmi.type, kmi.value)] if kmi.any: s.append(", any=True") @@ -436,7 +437,7 @@ class WM_OT_keyconfig_test(bpy.types.Operator): idname, spaceid, regionid, children = entry - km = kc.find_keymap(idname, space_type=spaceid, region_type=regionid) + km = kc.keymaps.find(idname, space_type=spaceid, region_type=regionid) if km: km = km.active() @@ -528,8 +529,8 @@ class WM_OT_keyconfig_import(bpy.types.Operator): config_name = None for line in f: - if line.startswith("kc = wm.add_keyconfig("): - config_name = line[23:-3] + if line.startswith("kc = wm.keyconfigs.new("): + config_name = line[24:-3] break if config_name is None: @@ -553,7 +554,7 @@ class WM_OT_keyconfig_import(bpy.types.Operator): # sneaky way to check we're actually running the code. wm = context.manager while config_name in wm.keyconfigs: - wm.remove_keyconfig(wm.keyconfigs[config_name]) + wm.keyconfigs.remove(wm.keyconfigs[config_name]) wm = context.manager totmap = len(wm.keyconfigs) @@ -607,7 +608,7 @@ class WM_OT_keyconfig_export(bpy.types.Operator): f.write("import bpy\n\n") f.write("wm = bpy.context.manager\n") - f.write("kc = wm.add_keyconfig('%s')\n\n" % name) + f.write("kc = wm.keyconfigs.new('%s')\n\n" % name) # Generate a list of keymaps to export: # @@ -633,12 +634,12 @@ class WM_OT_keyconfig_export(bpy.types.Operator): km = km.active() f.write("# Map %s\n" % km.name) - f.write("km = kc.add_keymap('%s', space_type='%s', region_type='%s', modal=%s)\n\n" % (km.name, km.space_type, km.region_type, km.is_modal)) + f.write("km = kc.keymaps.new('%s', space_type='%s', region_type='%s', modal=%s)\n\n" % (km.name, km.space_type, km.region_type, km.is_modal)) for kmi in km.items: if km.is_modal: - f.write("kmi = km.items.add_modal('%s', '%s', '%s'" % (kmi.propvalue, kmi.type, kmi.value)) + f.write("kmi = km.items.new_modal('%s', '%s', '%s'" % (kmi.propvalue, kmi.type, kmi.value)) else: - f.write("kmi = km.items.add('%s', '%s', '%s'" % (kmi.idname, kmi.type, kmi.value)) + f.write("kmi = km.items.new('%s', '%s', '%s'" % (kmi.idname, kmi.type, kmi.value)) if kmi.any: f.write(", any=True") else: @@ -731,9 +732,9 @@ class WM_OT_keyitem_add(bpy.types.Operator): kc = wm.keyconfigs.default if km.is_modal: - km.items.add_modal("", 'A', 'PRESS') # kmi + km.items.new_modal("", 'A', 'PRESS') # kmi else: - km.items.add("none", 'A', 'PRESS') # kmi + km.items.new("none", 'A', 'PRESS') # kmi # clear filter and expand keymap so we can see the newly added item if context.space_data.filter_text != "": @@ -755,7 +756,7 @@ class WM_OT_keyitem_remove(bpy.types.Operator): wm = context.manager km = context.keymap kmi = km.item_from_id(self.properties.item_id) - km.remove_item(kmi) + km.items.remove(kmi) return {'FINISHED'} @@ -787,7 +788,7 @@ class WM_OT_keyconfig_remove(bpy.types.Operator): if os.path.exists(path): os.remove(path) - wm.remove_keyconfig(keyconfig) + wm.keyconfigs.remove(keyconfig) return {'FINISHED'} def register(): diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index 10047c5a0f7..b2d6fe4ea34 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -851,7 +851,7 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac km = WM_keymap_add_item(keymap, OP_MIRROR, MKEY, KM_PRESS, KM_CTRL, 0); km = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TABKEY, KM_PRESS, KM_SHIFT, 0); - RNA_string_set(km->ptr, "data_path", "tool_settings.snap"); + RNA_string_set(km->ptr, "data_path", "tool_settings.use_snap"); km = WM_keymap_add_item(keymap, "TRANSFORM_OT_snap_type", TABKEY, KM_PRESS, KM_SHIFT|KM_CTRL, 0); @@ -929,7 +929,7 @@ void transform_keymap_for_space(wmKeyConfig *keyconf, wmKeyMap *keymap, int spac km = WM_keymap_add_item(keymap, "TRANSFORM_OT_mirror", MKEY, KM_PRESS, KM_CTRL, 0); km = WM_keymap_add_item(keymap, "WM_OT_context_toggle", TABKEY, KM_PRESS, KM_SHIFT, 0); - RNA_string_set(km->ptr, "data_path", "tool_settings.snap"); + RNA_string_set(km->ptr, "data_path", "tool_settings.use_snap"); break; default: break; diff --git a/source/blender/makesrna/intern/rna_action.c b/source/blender/makesrna/intern/rna_action.c index fe47d764fac..42ddf340f12 100644 --- a/source/blender/makesrna/intern/rna_action.c +++ b/source/blender/makesrna/intern/rna_action.c @@ -59,7 +59,7 @@ static void rna_ActionGroup_channels_next(CollectionPropertyIterator *iter) iter->valid= (internal->link != NULL); } -static bActionGroup *rna_Action_groups_add(bAction *act, char name[]) +static bActionGroup *rna_Action_groups_new(bAction *act, char name[]) { return action_groups_add_new(act, name); } @@ -149,6 +149,11 @@ static void rna_Action_pose_markers_remove(bAction *act, ReportList *reports, Ti MEM_freeN(marker); } +static void rna_Action_frame_range_get(PointerRNA *ptr,float *values) +{ + calc_action_range(ptr->id.data, values, values+1, 1); +} + #else static void rna_def_dopesheet(BlenderRNA *brna) @@ -361,7 +366,7 @@ static void rna_def_action_groups(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_sdna(srna, "bAction"); RNA_def_struct_ui_text(srna, "Action Groups", "Collection of action groups"); - func= RNA_def_function(srna, "add", "rna_Action_groups_add"); + func= RNA_def_function(srna, "new", "rna_Action_groups_new"); RNA_def_function_ui_description(func, "Add a keyframe to the curve."); parm= RNA_def_string(func, "name", "Group", 0, "", "New name for the action group."); RNA_def_property_flag(parm, PROP_REQUIRED); @@ -464,6 +469,10 @@ static void rna_def_action(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Pose Markers", "Markers specific to this Action, for labeling poses"); rna_def_action_pose_markers(brna, prop); + prop= RNA_def_float_vector(srna, "frame_range" , 2 , NULL , 0, 0, "Frame Range" , "The final frame range of all fcurves within this action" , 0 , 0); + RNA_def_property_float_funcs(prop, "rna_Action_frame_range_get" , NULL, NULL); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_api_action(srna); } diff --git a/source/blender/makesrna/intern/rna_action_api.c b/source/blender/makesrna/intern/rna_action_api.c index 0304ef2b0bd..9f64792932b 100644 --- a/source/blender/makesrna/intern/rna_action_api.c +++ b/source/blender/makesrna/intern/rna_action_api.c @@ -40,35 +40,11 @@ #include "DNA_anim_types.h" #include "DNA_curve_types.h" -/* return frame range of all curves (min, max) or (0, 1) if there are no keys */ -void rna_Action_get_frame_range(bAction *act, int **frame_range, int *length_r) -{ - int *ret; - float start, end; - - calc_action_range(act, &start, &end, 1); - - *length_r= 2; - ret= MEM_callocN(*length_r * sizeof(int), "rna_Action_get_frame_range"); - - ret[0]= (int)start; - ret[1]= (int)end; - - *frame_range= ret; -} - #else void RNA_api_action(StructRNA *srna) { - FunctionRNA *func; - PropertyRNA *parm; - - func= RNA_def_function(srna, "get_frame_range", "rna_Action_get_frame_range"); - RNA_def_function_ui_description(func, "Get action frame range as a (min, max) tuple."); - parm= RNA_def_int_array(func, "frame_range", 1, NULL, 0, 0, "", "Action frame range.", 0, 0); - RNA_def_property_flag(parm, PROP_DYNAMIC); - RNA_def_function_output(func, parm); + } #endif diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 5ff1dbcd2b9..c21c6fb4aba 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -2932,7 +2932,7 @@ static void rna_def_timeline_markers(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_sdna(srna, "Scene"); RNA_def_struct_ui_text(srna, "Timeline Markers", "Collection of timeline markers"); - func= RNA_def_function(srna, "add", "rna_TimeLine_add"); + func= RNA_def_function(srna, "new", "rna_TimeLine_add"); RNA_def_function_ui_description(func, "Add a keyframe to the curve."); parm= RNA_def_string(func, "name", "Marker", 0, "", "New name for the marker (not unique)."); RNA_def_property_flag(parm, PROP_REQUIRED); diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index d13e4f9f616..231ca01fe25 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -928,7 +928,7 @@ static StructRNA* rna_MacroOperator_refine(PointerRNA *opr) return (op->type && op->type->ext.srna)? op->type->ext.srna: &RNA_Macro; } -static wmKeyMapItem *rna_KeyMap_add_item(wmKeyMap *km, ReportList *reports, char *idname, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier) +static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, char *idname, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier) { // wmWindowManager *wm = CTX_wm_manager(C); int modifier= 0; @@ -949,7 +949,7 @@ static wmKeyMapItem *rna_KeyMap_add_item(wmKeyMap *km, ReportList *reports, char return WM_keymap_add_item(km, idname, type, value, modifier, keymodifier); } -static wmKeyMapItem *rna_KeyMap_add_modal_item(wmKeyMap *km, bContext *C, ReportList *reports, char* propvalue_str, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier) +static wmKeyMapItem *rna_KeyMap_item_new_modal(wmKeyMap *km, bContext *C, ReportList *reports, char* propvalue_str, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier) { wmWindowManager *wm = CTX_wm_manager(C); int modifier= 0; @@ -988,6 +988,30 @@ static wmKeyMapItem *rna_KeyMap_add_modal_item(wmKeyMap *km, bContext *C, Report return WM_modalkeymap_add_item(km, type, value, modifier, keymodifier, propvalue); } +static wmKeyMap *rna_keymap_new(wmKeyConfig *keyconf, char *idname, int spaceid, int regionid, int modal) +{ + if (modal == 0) { + return WM_keymap_find(keyconf, idname, spaceid, regionid); + } else { + return WM_modalkeymap_add(keyconf, idname, NULL); /* items will be lazy init */ + } +} + +static wmKeyMap *rna_keymap_find(wmKeyConfig *keyconf, char *idname, int spaceid, int regionid) +{ + return WM_keymap_list_find(&keyconf->keymaps, idname, spaceid, regionid); +} + +static wmKeyMap *rna_keymap_find_modal(wmKeyConfig *keyconf, char *idname) +{ + wmOperatorType *ot = WM_operatortype_find(idname, 0); + + if (!ot) + return NULL; + else + return ot->modalkeymap; +} + #else /* RNA_RUNTIME */ static void rna_def_operator(BlenderRNA *brna) @@ -1270,27 +1294,14 @@ static void rna_def_wm_keyconfigs(BlenderRNA *brna, PropertyRNA *cprop) StructRNA *srna; PropertyRNA *prop; - //FunctionRNA *func; - //PropertyRNA *parm; + FunctionRNA *func; + PropertyRNA *parm; RNA_def_property_srna(cprop, "KeyConfigurations"); srna= RNA_def_struct(brna, "KeyConfigurations", NULL); RNA_def_struct_sdna(srna, "wmWindowManager"); RNA_def_struct_ui_text(srna, "KeyConfigs", "Collection of KeyConfigs"); -/* - func= RNA_def_function(srna, "new", "rna_Curve_spline_new"); - RNA_def_function_ui_description(func, "Add a new spline to the curve."); - parm= RNA_def_enum(func, "type", curve_type_items, CU_POLY, "", "type for the new spline."); - RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "spline", "Spline", "", "The newly created spline."); - RNA_def_function_return(func, parm); - func= RNA_def_function(srna, "remove", "rna_Curve_spline_remove"); - RNA_def_function_ui_description(func, "Remove a spline from a curve."); - RNA_def_function_flag(func, FUNC_USE_REPORTS); - parm= RNA_def_pointer(func, "spline", "Spline", "", "The spline to remove."); - RNA_def_property_flag(parm, PROP_REQUIRED|PROP_NEVER_NULL); -*/ prop= RNA_def_property(srna, "active", PROP_POINTER, PROP_NONE); RNA_def_property_struct_type(prop, "KeyConfig"); RNA_def_property_pointer_funcs(prop, "rna_WindowManager_active_keyconfig_get", "rna_WindowManager_active_keyconfig_set", NULL, NULL); @@ -1301,6 +1312,17 @@ static void rna_def_wm_keyconfigs(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_property_pointer_sdna(prop, NULL, "defaultconf"); RNA_def_property_struct_type(prop, "KeyConfig"); RNA_def_property_ui_text(prop, "Default Key Configuration", ""); + + /* funcs */ + func= RNA_def_function(srna, "new", "WM_keyconfig_new_user"); // add_keyconfig + parm= RNA_def_string(func, "name", "", 0, "Name", ""); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_pointer(func, "keyconfig", "KeyConfig", "Key Configuration", "Added key configuration."); + RNA_def_function_return(func, parm); + + func= RNA_def_function(srna, "remove", "WM_keyconfig_remove"); // remove_keyconfig + parm= RNA_def_pointer(func, "keyconfig", "KeyConfig", "Key Configuration", "Removed key configuration."); + RNA_def_property_flag(parm, PROP_REQUIRED); } static void rna_def_windowmanager(BlenderRNA *brna) @@ -1347,7 +1369,7 @@ static void rna_def_keymap_items(BlenderRNA *brna, PropertyRNA *cprop) RNA_def_struct_sdna(srna, "wmKeyMap"); RNA_def_struct_ui_text(srna, "KeyMap Items", "Collection of keymap items"); - func= RNA_def_function(srna, "add", "rna_KeyMap_add_item"); + func= RNA_def_function(srna, "new", "rna_KeyMap_item_new"); RNA_def_function_flag(func, FUNC_USE_REPORTS); parm= RNA_def_string(func, "idname", "", 0, "Operator Identifier", ""); RNA_def_property_flag(parm, PROP_REQUIRED); @@ -1364,7 +1386,7 @@ static void rna_def_keymap_items(BlenderRNA *brna, PropertyRNA *cprop) parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", "Added key map item."); RNA_def_function_return(func, parm); - func= RNA_def_function(srna, "add_modal", "rna_KeyMap_add_modal_item"); + func= RNA_def_function(srna, "new_modal", "rna_KeyMap_item_new_modal"); RNA_def_function_flag(func, FUNC_USE_CONTEXT|FUNC_USE_REPORTS); parm= RNA_def_string(func, "propvalue", "", 0, "Property Value", ""); RNA_def_property_flag(parm, PROP_REQUIRED); @@ -1381,6 +1403,49 @@ static void rna_def_keymap_items(BlenderRNA *brna, PropertyRNA *cprop) parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", "Added key map item."); RNA_def_function_return(func, parm); + func= RNA_def_function(srna, "remove", "WM_keymap_remove_item"); + parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", ""); + RNA_def_property_flag(parm, PROP_REQUIRED); + +} + +static void rna_def_wm_keymaps(BlenderRNA *brna, PropertyRNA *cprop) +{ + StructRNA *srna; + //PropertyRNA *prop; + + FunctionRNA *func; + PropertyRNA *parm; + + + RNA_def_property_srna(cprop, "KeyMaps"); + srna= RNA_def_struct(brna, "KeyMaps", NULL); + RNA_def_struct_sdna(srna, "wmKeyConfig"); + RNA_def_struct_ui_text(srna, "Key Maps", "Collection of keymaps"); + + func= RNA_def_function(srna, "new", "rna_keymap_new"); // add_keymap + parm= RNA_def_string(func, "name", "", 0, "Name", ""); + RNA_def_property_flag(parm, PROP_REQUIRED); + RNA_def_enum(func, "space_type", space_type_items, SPACE_EMPTY, "Space Type", ""); + RNA_def_enum(func, "region_type", region_type_items, RGN_TYPE_WINDOW, "Region Type", ""); + RNA_def_boolean(func, "modal", 0, "Modal", ""); + parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Added key map."); + RNA_def_function_return(func, parm); + + func= RNA_def_function(srna, "find", "rna_keymap_find"); // find_keymap + parm= RNA_def_string(func, "name", "", 0, "Name", ""); + RNA_def_property_flag(parm, PROP_REQUIRED); + RNA_def_enum(func, "space_type", space_type_items, SPACE_EMPTY, "Space Type", ""); + RNA_def_enum(func, "region_type", region_type_items, RGN_TYPE_WINDOW, "Region Type", ""); + parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Corresponding key map."); + RNA_def_function_return(func, parm); + + func= RNA_def_function(srna, "find_modal", "rna_keymap_find_modal"); // find_keymap_modal + parm= RNA_def_string(func, "name", "", 0, "Operator Name", ""); + RNA_def_property_flag(parm, PROP_REQUIRED); + parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Corresponding key map."); + RNA_def_function_return(func, parm); + } static void rna_def_keyconfig(BlenderRNA *brna) @@ -1407,10 +1472,11 @@ static void rna_def_keyconfig(BlenderRNA *brna) RNA_def_property_string_sdna(prop, NULL, "idname"); RNA_def_property_ui_text(prop, "Name", "Name of the key configuration"); RNA_def_struct_name_property(srna, prop); - + prop= RNA_def_property(srna, "keymaps", PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, "KeyMap"); RNA_def_property_ui_text(prop, "Key Maps", "Key maps configured as part of this configuration"); + rna_def_wm_keymaps(brna, prop); prop= RNA_def_property(srna, "is_user_defined", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "flag", KEYCONF_USER); diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c index 0f72cfa8b9d..5f1e8f65f43 100644 --- a/source/blender/makesrna/intern/rna_wm_api.c +++ b/source/blender/makesrna/intern/rna_wm_api.c @@ -39,31 +39,6 @@ #include "BKE_context.h" - -static wmKeyMap *rna_keymap_add(wmKeyConfig *keyconf, char *idname, int spaceid, int regionid, int modal) -{ - if (modal == 0) { - return WM_keymap_find(keyconf, idname, spaceid, regionid); - } else { - return WM_modalkeymap_add(keyconf, idname, NULL); /* items will be lazy init */ - } -} - -static wmKeyMap *rna_keymap_find(wmKeyConfig *keyconf, char *idname, int spaceid, int regionid) -{ - return WM_keymap_list_find(&keyconf->keymaps, idname, spaceid, regionid); -} - -static wmKeyMap *rna_keymap_find_modal(wmKeyConfig *keyconf, char *idname) -{ - wmOperatorType *ot = WM_operatortype_find(idname, 0); - - if (!ot) - return NULL; - else - return ot->modalkeymap; -} - static wmKeyMap *rna_keymap_active(wmKeyMap *km, bContext *C) { wmWindowManager *wm = CTX_wm_manager(C); @@ -132,16 +107,6 @@ void RNA_api_wm(StructRNA *srna) RNA_def_function_ui_description(func, "Show up the file selector."); rna_generic_op_invoke(func, 0); - func= RNA_def_function(srna, "add_keyconfig", "WM_keyconfig_add_user"); - parm= RNA_def_string(func, "name", "", 0, "Name", ""); - RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "keyconfig", "KeyConfig", "Key Configuration", "Added key configuration."); - RNA_def_function_return(func, parm); - - func= RNA_def_function(srna, "remove_keyconfig", "WM_keyconfig_remove"); - parm= RNA_def_pointer(func, "keyconfig", "KeyConfig", "Key Configuration", "Removed key configuration."); - RNA_def_property_flag(parm, PROP_REQUIRED); - func= RNA_def_function(srna, "add_modal_handler", "rna_event_add_modal_handler"); RNA_def_function_flag(func, FUNC_NO_SELF|FUNC_USE_CONTEXT); parm= RNA_def_pointer(func, "operator", "Operator", "", "Operator to call."); @@ -259,31 +224,8 @@ void RNA_api_macro(StructRNA *srna) void RNA_api_keyconfig(StructRNA *srna) { - FunctionRNA *func; - PropertyRNA *parm; - - func= RNA_def_function(srna, "add_keymap", "rna_keymap_add"); - parm= RNA_def_string(func, "name", "", 0, "Name", ""); - RNA_def_property_flag(parm, PROP_REQUIRED); - RNA_def_enum(func, "space_type", space_type_items, SPACE_EMPTY, "Space Type", ""); - RNA_def_enum(func, "region_type", region_type_items, RGN_TYPE_WINDOW, "Region Type", ""); - RNA_def_boolean(func, "modal", 0, "Modal", ""); - parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Added key map."); - RNA_def_function_return(func, parm); - - func= RNA_def_function(srna, "find_keymap", "rna_keymap_find"); - parm= RNA_def_string(func, "name", "", 0, "Name", ""); - RNA_def_property_flag(parm, PROP_REQUIRED); - RNA_def_enum(func, "space_type", space_type_items, SPACE_EMPTY, "Space Type", ""); - RNA_def_enum(func, "region_type", region_type_items, RGN_TYPE_WINDOW, "Region Type", ""); - parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Corresponding key map."); - RNA_def_function_return(func, parm); - - func= RNA_def_function(srna, "find_keymap_modal", "rna_keymap_find_modal"); - parm= RNA_def_string(func, "name", "", 0, "Operator Name", ""); - RNA_def_property_flag(parm, PROP_REQUIRED); - parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Corresponding key map."); - RNA_def_function_return(func, parm); + // FunctionRNA *func; + // PropertyRNA *parm; } void RNA_api_keymap(StructRNA *srna) @@ -296,10 +238,6 @@ void RNA_api_keymap(StructRNA *srna) parm= RNA_def_pointer(func, "keymap", "KeyMap", "Key Map", "Active key map."); RNA_def_function_return(func, parm); - func= RNA_def_function(srna, "remove_item", "WM_keymap_remove_item"); - parm= RNA_def_pointer(func, "item", "KeyMapItem", "Item", ""); - RNA_def_property_flag(parm, PROP_REQUIRED); - func= RNA_def_function(srna, "item_from_id", "WM_keymap_item_find_id"); parm= RNA_def_property(func, "id", PROP_INT, PROP_NONE); RNA_def_property_flag(parm, PROP_REQUIRED); diff --git a/source/blender/windowmanager/WM_api.h b/source/blender/windowmanager/WM_api.h index 9fe09c0836c..9668b2e17c9 100644 --- a/source/blender/windowmanager/WM_api.h +++ b/source/blender/windowmanager/WM_api.h @@ -97,8 +97,8 @@ void WM_paint_cursor_end(struct wmWindowManager *wm, void *handle); void WM_cursor_warp (struct wmWindow *win, int x, int y); /* keyconfig and keymap */ -wmKeyConfig *WM_keyconfig_add (struct wmWindowManager *wm, char *idname); -wmKeyConfig *WM_keyconfig_add_user(struct wmWindowManager *wm, char *idname); +wmKeyConfig *WM_keyconfig_new (struct wmWindowManager *wm, char *idname); +wmKeyConfig *WM_keyconfig_new_user(struct wmWindowManager *wm, char *idname); void WM_keyconfig_remove (struct wmWindowManager *wm, struct wmKeyConfig *keyconf); void WM_keyconfig_free (struct wmKeyConfig *keyconf); void WM_keyconfig_userdef(struct wmWindowManager *wm); diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index 8d36711032b..afa11616cfd 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -195,7 +195,7 @@ void WM_keymap_init(bContext *C) wmWindowManager *wm= CTX_wm_manager(C); if(!wm->defaultconf) - wm->defaultconf= WM_keyconfig_add(wm, "Blender"); + wm->defaultconf= WM_keyconfig_new(wm, "Blender"); if(wm && CTX_py_init_get(C) && (wm->initialized & WM_INIT_KEYMAP) == 0) { /* create default key config */ diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index e79d08dc2f1..f1873b14232 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -74,7 +74,7 @@ void WM_keymap_properties_reset(wmKeyMapItem *kmi) keymap_properties_set(kmi); } -wmKeyConfig *WM_keyconfig_add(wmWindowManager *wm, char *idname) +wmKeyConfig *WM_keyconfig_new(wmWindowManager *wm, char *idname) { wmKeyConfig *keyconf; @@ -85,9 +85,9 @@ wmKeyConfig *WM_keyconfig_add(wmWindowManager *wm, char *idname) return keyconf; } -wmKeyConfig *WM_keyconfig_add_user(wmWindowManager *wm, char *idname) +wmKeyConfig *WM_keyconfig_new_user(wmWindowManager *wm, char *idname) { - wmKeyConfig *keyconf = WM_keyconfig_add(wm, idname); + wmKeyConfig *keyconf = WM_keyconfig_new(wm, idname); keyconf->flag |= KEYCONF_USER; |