diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-06-25 18:39:58 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-06-25 18:46:01 +0300 |
commit | 72cf239780a3733fb0aec0bb8c9e65547096d352 (patch) | |
tree | d4be0c0d620e25fffbd7ef220cdc14c12dece1df /release | |
parent | 1b064697f13da0463a25dd747a11c18d2ddda64c (diff) |
Tool System: add UV transform tools
Diffstat (limited to 'release')
-rw-r--r-- | release/scripts/presets/keyconfig/keymap_data/blender_default.py | 36 | ||||
-rw-r--r-- | release/scripts/startup/bl_ui/space_toolsystem_toolbar.py | 36 |
2 files changed, 72 insertions, 0 deletions
diff --git a/release/scripts/presets/keyconfig/keymap_data/blender_default.py b/release/scripts/presets/keyconfig/keymap_data/blender_default.py index 8f3f6468134..4f907bf3e80 100644 --- a/release/scripts/presets/keyconfig/keymap_data/blender_default.py +++ b/release/scripts/presets/keyconfig/keymap_data/blender_default.py @@ -4992,6 +4992,39 @@ def km_image_editor_tool_uv_sculpt_stroke(params): ) +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": params.tool_tweak, "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": params.tool_tweak, "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": params.tool_tweak, "value": 'ANY'}, + {"properties": [("release_confirm", True)]}), + ]}, + ) + + def km_node_editor_tool_select(params): return ( "Node Tool: Select", @@ -5978,6 +6011,9 @@ def generate_keymaps(params=None): km_image_editor_tool_uv_select_circle(params), km_image_editor_tool_uv_select_lasso(params), km_image_editor_tool_uv_sculpt_stroke(params), + km_image_editor_tool_uv_move(params), + km_image_editor_tool_uv_rotate(params), + km_image_editor_tool_uv_scale(params), km_node_editor_tool_select(params), km_node_editor_tool_select_box(params), km_node_editor_tool_select_lasso(params), diff --git a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py index 5fcf117ecf1..a306ee68b7a 100644 --- a/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py +++ b/release/scripts/startup/bl_ui/space_toolsystem_toolbar.py @@ -1134,6 +1134,39 @@ class _defs_image_generic: class _defs_image_uv_transform: @ToolDef.from_fn + def translate(): + return dict( + idname="builtin.move", + label="Move", + icon="ops.transform.translate", + # widget="VIEW3D_GGT_xform_gizmo", + operator="transform.translate", + keymap="Image Editor Tool: Uv, Move", + ) + + @ToolDef.from_fn + def rotate(): + return dict( + idname="builtin.rotate", + label="Rotate", + icon="ops.transform.rotate", + # widget="VIEW3D_GGT_xform_gizmo", + operator="transform.rotate", + keymap="Image Editor Tool: Uv, Rotate", + ) + + @ToolDef.from_fn + def scale(): + return dict( + idname="builtin.scale", + label="Scale", + icon="ops.transform.resize", + # widget="VIEW3D_GGT_xform_gizmo", + operator="transform.resize", + keymap="Image Editor Tool: Uv, Scale", + ) + + @ToolDef.from_fn def transform(): return dict( idname="builtin.transform", @@ -1616,6 +1649,9 @@ class IMAGE_PT_tools_active(ToolSelectPanelHelper, Panel): # for reuse _tools_transform = ( + _defs_image_uv_transform.translate, + _defs_image_uv_transform.rotate, + _defs_image_uv_transform.scale, _defs_image_uv_transform.transform, ) |