Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/presets/keyconfig/keymap_data/blender_default.py
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 436 Lines • ▼ Show 20 Lines | def _template_items_change_frame(params): | ||||
| else: | else: | ||||
| return [ | return [ | ||||
| ("anim.change_frame", {"type": params.action_mouse, "value": 'PRESS'}, None), | ("anim.change_frame", {"type": params.action_mouse, "value": 'PRESS'}, None), | ||||
| ] | ] | ||||
| # Tool System Templates | # Tool System Templates | ||||
| def _template_items_tool_select(params, operator, cursor_operator, *, extend): | def _template_items_tool_select(params, operator, cursor_operator, fallback, *, extend): | ||||
| if params.select_mouse == 'LEFTMOUSE': | if params.select_mouse == 'LEFTMOUSE': | ||||
| # Immediate select without quick delay. | # By default use 'PRESS' for immediate select without quick delay. | ||||
| # Fallback key-maps 'CLICK' since 'PRESS' events passes through (allowing either click or drag). | |||||
| # When the active (non-fallback) tools that activate on drag this makes it | |||||
Severin: There's something missing here I think? Sentence doesn't make much sense :) | |||||
campbellbartonAuthorUnsubmitted Done Inline ActionsIndeed! Updated it should be clearer now. campbellbarton: Indeed! Updated it should be clearer now. | |||||
| # impossible to use the tool without selecting elements under the cursor. | |||||
| return [ | return [ | ||||
| (operator, {"type": 'LEFTMOUSE', "value": 'PRESS'}, | (operator, {"type": 'LEFTMOUSE', "value": 'CLICK' if fallback else 'PRESS'}, | ||||
| {"properties": [("deselect_all", True)]}), | {"properties": [("deselect_all", True)]}), | ||||
| (operator, {"type": 'LEFTMOUSE', "value": 'PRESS', "shift": True}, | (operator, {"type": 'LEFTMOUSE', "value": 'CLICK' if fallback else 'PRESS', "shift": True}, | ||||
| {"properties": [(extend, True)]}), | {"properties": [(extend, True)]}), | ||||
| ] | ] | ||||
| else: | else: | ||||
| # For right mouse, set the cursor. | # For right mouse, set the cursor. | ||||
| return [ | return [ | ||||
| (cursor_operator, {"type": 'LEFTMOUSE', "value": 'PRESS'}, None), | (cursor_operator, {"type": 'LEFTMOUSE', "value": 'PRESS'}, None), | ||||
| ("transform.translate", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, | ("transform.translate", {"type": 'EVT_TWEAK_L', "value": 'ANY'}, | ||||
| {"properties": [("release_confirm", True), ("cursor_transform", True)]}), | {"properties": [("release_confirm", True), ("cursor_transform", True)]}), | ||||
| ▲ Show 20 Lines • Show All 5,818 Lines • ▼ Show 20 Lines | |||||
| def km_image_editor_tool_uv_select(params, *, fallback): | def km_image_editor_tool_uv_select(params, *, fallback): | ||||
| return ( | return ( | ||||
| _fallback_id("Image Editor Tool: Uv, Tweak", fallback), | _fallback_id("Image Editor Tool: Uv, Tweak", fallback), | ||||
| {"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'}, | {"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'}, | ||||
| {"items": [ | {"items": [ | ||||
| *([] if (fallback and (params.select_mouse == 'RIGHTMOUSE')) else _template_items_tool_select( | *([] if (fallback and (params.select_mouse == 'RIGHTMOUSE')) else _template_items_tool_select( | ||||
| params, "uv.select", "uv.cursor_set", extend="extend")), | params, "uv.select", "uv.cursor_set", fallback, extend="extend")), | ||||
| *([] if (not params.use_fallback_tool_rmb) else _template_uv_select( | *([] if (not params.use_fallback_tool_rmb) else _template_uv_select( | ||||
| type=params.select_mouse, value=params.select_mouse_value, legacy=params.legacy)), | type=params.select_mouse, value=params.select_mouse_value, legacy=params.legacy)), | ||||
| ]}, | ]}, | ||||
| ) | ) | ||||
| def km_image_editor_tool_uv_select_box(params, *, fallback): | def km_image_editor_tool_uv_select_box(params, *, fallback): | ||||
| return ( | return ( | ||||
| ▲ Show 20 Lines • Show All 190 Lines • ▼ Show 20 Lines | |||||
| def km_3d_view_tool_select(params, *, fallback): | def km_3d_view_tool_select(params, *, fallback): | ||||
| return ( | return ( | ||||
| _fallback_id("3D View Tool: Tweak", fallback), | _fallback_id("3D View Tool: Tweak", fallback), | ||||
| {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, | {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, | ||||
| {"items": [ | {"items": [ | ||||
| *([] if (fallback and (params.select_mouse == 'RIGHTMOUSE')) else _template_items_tool_select( | *([] if (fallback and (params.select_mouse == 'RIGHTMOUSE')) else _template_items_tool_select( | ||||
| params, "view3d.select", "view3d.cursor3d", extend="toggle")), | params, "view3d.select", "view3d.cursor3d", fallback, extend="toggle")), | ||||
| *([] if (not params.use_fallback_tool_rmb) else _template_view3d_select( | *([] if (not params.use_fallback_tool_rmb) else _template_view3d_select( | ||||
| type=params.select_mouse, value=params.select_mouse_value, legacy=params.legacy, exclude_mod="ctrl")), | type=params.select_mouse, value=params.select_mouse_value, legacy=params.legacy, exclude_mod="ctrl")), | ||||
| ]}, | ]}, | ||||
| ) | ) | ||||
| def km_3d_view_tool_select_box(params, *, fallback): | def km_3d_view_tool_select_box(params, *, fallback): | ||||
| return ( | return ( | ||||
| ▲ Show 20 Lines • Show All 895 Lines • ▼ Show 20 Lines | |||||
| # Tool System (3D View, Grease Pencil, Edit) | # Tool System (3D View, Grease Pencil, Edit) | ||||
| def km_3d_view_tool_edit_gpencil_select(params, *, fallback): | def km_3d_view_tool_edit_gpencil_select(params, *, fallback): | ||||
| return ( | return ( | ||||
| _fallback_id("3D View Tool: Edit Gpencil, Tweak", fallback), | _fallback_id("3D View Tool: Edit Gpencil, Tweak", fallback), | ||||
| {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, | {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, | ||||
| {"items": [ | {"items": [ | ||||
| *([] if (fallback and (params.select_mouse == 'RIGHTMOUSE')) else _template_items_tool_select( | *([] if (fallback and (params.select_mouse == 'RIGHTMOUSE')) else _template_items_tool_select( | ||||
| params, "gpencil.select", "view3d.cursor3d", extend="toggle")), | params, "gpencil.select", "view3d.cursor3d", fallback, extend="toggle")), | ||||
| *([] if (not params.use_fallback_tool_rmb) else _template_view3d_gpencil_select( | *([] if (not params.use_fallback_tool_rmb) else _template_view3d_gpencil_select( | ||||
| type=params.select_mouse, value=params.select_mouse_value, legacy=params.legacy)), | type=params.select_mouse, value=params.select_mouse_value, legacy=params.legacy)), | ||||
| ]}, | ]}, | ||||
| ) | ) | ||||
| def km_3d_view_tool_edit_gpencil_select_box(params, *, fallback): | def km_3d_view_tool_edit_gpencil_select_box(params, *, fallback): | ||||
| return ( | return ( | ||||
| ▲ Show 20 Lines • Show All 121 Lines • ▼ Show 20 Lines | |||||
| # ------------------------------------------------------------------------------ | # ------------------------------------------------------------------------------ | ||||
| # Tool System (3D View, Grease Pencil, Sculpt) | # Tool System (3D View, Grease Pencil, Sculpt) | ||||
| def km_3d_view_tool_sculpt_gpencil_select(params): | def km_3d_view_tool_sculpt_gpencil_select(params): | ||||
| return ( | return ( | ||||
| "3D View Tool: Sculpt Gpencil, Tweak", | "3D View Tool: Sculpt Gpencil, Tweak", | ||||
| {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, | {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, | ||||
| {"items": _template_items_tool_select(params, "gpencil.select", "view3d.cursor3d", extend="toggle")}, | {"items": _template_items_tool_select(params, "gpencil.select", "view3d.cursor3d", False, extend="toggle")}, | ||||
| ) | ) | ||||
| def km_3d_view_tool_sculpt_gpencil_select_box(params): | def km_3d_view_tool_sculpt_gpencil_select_box(params): | ||||
| return ( | return ( | ||||
| "3D View Tool: Sculpt Gpencil, Select Box", | "3D View Tool: Sculpt Gpencil, Select Box", | ||||
| {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, | {"space_type": 'VIEW_3D', "region_type": 'WINDOW'}, | ||||
| {"items": _template_items_tool_select_actions("gpencil.select_box", **params.tool_tweak_event)}, | {"items": _template_items_tool_select_actions("gpencil.select_box", **params.tool_tweak_event)}, | ||||
| Show All 23 Lines | |||||
| # Tool System (Sequencer, Generic) | # Tool System (Sequencer, Generic) | ||||
| def km_sequencer_editor_tool_generic_select(params, *, fallback): | def km_sequencer_editor_tool_generic_select(params, *, fallback): | ||||
| return ( | return ( | ||||
| _fallback_id("Sequencer Tool: Tweak", fallback), | _fallback_id("Sequencer Tool: Tweak", fallback), | ||||
| {"space_type": 'SEQUENCE_EDITOR', "region_type": 'WINDOW'}, | {"space_type": 'SEQUENCE_EDITOR', "region_type": 'WINDOW'}, | ||||
| {"items": [ | {"items": [ | ||||
| *([] if (fallback and (params.select_mouse == 'RIGHTMOUSE')) else _template_items_tool_select( | *([] if (fallback and (params.select_mouse == 'RIGHTMOUSE')) else _template_items_tool_select( | ||||
| params, "sequencer.select", "sequencer.cursor_set", extend="toggle")), | params, "sequencer.select", "sequencer.cursor_set", fallback, extend="toggle")), | ||||
| *([] if (not params.use_fallback_tool_rmb) else _template_sequencer_preview_select( | *([] if (not params.use_fallback_tool_rmb) else _template_sequencer_preview_select( | ||||
| type=params.select_mouse, value=params.select_mouse_value, legacy=params.legacy)), | type=params.select_mouse, value=params.select_mouse_value, legacy=params.legacy)), | ||||
| # Ignored for preview. | # Ignored for preview. | ||||
| *_template_items_change_frame(params), | *_template_items_change_frame(params), | ||||
| ]}, | ]}, | ||||
| ) | ) | ||||
| ▲ Show 20 Lines • Show All 387 Lines • Show Last 20 Lines | |||||
There's something missing here I think? Sentence doesn't make much sense :)