UV: Move on Axis selected UVs operator

The operator moves selected UVs, using the num-pad for directional keys:

Modifiers control the units:
- UDIM / UV unit (NUMPAD KEY)
- Dynamic grid unit (CTRL + NUMPAD KEY)
- Pixel unit (SHIFT + NUMPAD KEY)

Implements design task #78405.

Ref !139608
This commit is contained in:
Eitan Traurig
2025-10-03 15:50:14 +10:00
committed by Campbell Barton
parent eed9e557ec
commit cfad6f4f25
3 changed files with 115 additions and 0 deletions

View File

@@ -1418,6 +1418,24 @@ def km_uv_editor(params):
op_menu("IMAGE_MT_uvs_merge", {"type": 'M', "value": 'PRESS'}),
op_menu("IMAGE_MT_uvs_split", {"type": 'M', "value": 'PRESS', "alt": True}),
op_menu("IMAGE_MT_uvs_align", {"type": 'W', "value": 'PRESS', "shift": True}),
*[
(
"uv.move_on_axis",
{"type": key, "value": 'PRESS', **mod_dict},
{"properties": [("axis", axis), ("type", move_type), ("distance", distance)]}
)
for mod_dict, move_type in (
({"ctrl": True}, 'DYNAMIC'),
({"shift": True}, 'PIXEL'),
({}, 'UDIM'),
)
for key, axis, distance in (
('NUMPAD_8', 'Y', 1),
('NUMPAD_2', 'Y', -1),
('NUMPAD_6', 'X', 1),
('NUMPAD_4', 'X', -1),
)
],
("uv.stitch", {"type": 'V', "value": 'PRESS', "alt": True}, None),
("uv.rip_move", {"type": 'V', "value": 'PRESS'}, None),
("uv.pin", {"type": 'P', "value": 'PRESS'},

View File

@@ -484,6 +484,7 @@ class IMAGE_MT_uvs(Menu):
layout.operator_context = 'EXEC_REGION_WIN'
layout.menu("IMAGE_MT_uvs_align")
layout.operator("uv.align_rotation")
layout.operator_menu_enum("uv.move_on_axis", "type", text="Move on Axis")
layout.separator()