Industry Compat keymap: Support MMB for immediate transform tool use again

Now this also works for the UV Editor

Note: Only the transform tools currently support this. I would like to make this work for all the tools with gizmos, but need to find the nicest way to do it.
This commit is contained in:
William Reynish 2020-01-06 20:37:47 +01:00
parent 04ddd6f717
commit 58e88d3816
1 changed files with 92 additions and 0 deletions

View File

@ -3553,6 +3553,89 @@ def km_transform_modal_map(_params):
return keymap
# ------------------------------------------------------------------------------
# Tool System Keymaps
#
# Named are auto-generated based on the tool name and it's toolbar.
def km_image_editor_tool_uv_move(params):
return (
"Image Editor Tool: Uv, Move",
{"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'},
{"items": [
("transform.translate", {"type": 'EVT_TWEAK_M', "value": 'ANY'},
{"properties": [("release_confirm", True)]}),
]},
)
def km_image_editor_tool_uv_rotate(params):
return (
"Image Editor Tool: Uv, Rotate",
{"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'},
{"items": [
("transform.rotate", {"type": 'EVT_TWEAK_M', "value": 'ANY'},
{"properties": [("release_confirm", True)]}),
]},
)
def km_image_editor_tool_uv_scale(params):
return (
"Image Editor Tool: Uv, Scale",
{"space_type": 'IMAGE_EDITOR', "region_type": 'WINDOW'},
{"items": [
("transform.resize", {"type": 'EVT_TWEAK_M', "value": 'ANY'},
{"properties": [("release_confirm", True)]}),
]},
)
def km_3d_view_tool_move(params):
return (
"3D View Tool: Move",
{"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
{"items": [
("transform.translate", {"type": 'EVT_TWEAK_M', "value": 'ANY'},
{"properties": [("release_confirm", True)]}),
]},
)
def km_3d_view_tool_rotate(params):
return (
"3D View Tool: Rotate",
{"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
{"items": [
("transform.rotate", {"type": 'EVT_TWEAK_M', "value": 'ANY'},
{"properties": [("release_confirm", True)]}),
]},
)
def km_3d_view_tool_scale(params):
return (
"3D View Tool: Scale",
{"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
{"items": [
("transform.resize", {"type": 'EVT_TWEAK_M', "value": 'ANY'},
{"properties": [("release_confirm", True)]}),
]},
)
def km_3d_view_tool_transform(params):
return (
"3D View Tool: Transform",
{"space_type": 'VIEW_3D', "region_type": 'WINDOW'},
{"items": [
("transform.from_gizmo", {"type": 'EVT_TWEAK_M', "value": 'ANY'}, None),
]},
)
# ------------------------------------------------------------------------------
# Full Configuration
@ -3641,4 +3724,13 @@ def generate_keymaps(params=None):
km_eyedropper_colorramp_pointsampling_map(params),
km_transform_modal_map(params),
# Tool System.
km_image_editor_tool_uv_move(params),
km_image_editor_tool_uv_rotate(params),
km_image_editor_tool_uv_scale(params),
km_3d_view_tool_transform(params),
km_3d_view_tool_move(params),
km_3d_view_tool_rotate(params),
km_3d_view_tool_scale(params),
]