Skip to content

UV: Slice C — UV transforms with undo (move/rotate/scale) #461

Description

@fernandotonon

Parent epic: #458
Depends on: Slice B

Goal

Edit UVs with move/rotate/scale, snapping, and full undo/redo through the existing UndoManager.

Scope

  • Transform shortcuts inside the UV panel: G = move, R = rotate, S = scale (Blender-convention, since 3D side uses Unity convention Q/W/E/R — these are free in 2D context). Configurable to W/E/R if the user prefers.
  • Numeric input during transform: type 0.5<Enter> to scale by 0.5, 90<Enter> to rotate 90°.
  • Pivot options: median of selection, individual origins, 2D cursor.
  • Snap modes: to grid, to vertex, to texture pixel (when texture preview is on). Hold Ctrl to invert snap.
  • Mirror X / Mirror Y on selection.
  • New command class UVEditCommand in src/commands/. One command per transform (not per vertex — match the EditMeshTopologyCommand precedent).
  • Writes through EditableMesh::setVertexUV. Bumps the EditableMesh revision so the panel and the 3D viewport refresh.

Acceptance Criteria

  • Move/rotate/scale work with mouse drag and with keyboard numeric input.
  • All three pivot modes produce expected results on a 4-vertex selection.
  • Snap-to-grid and snap-to-vertex work; snap-to-pixel works when a texture is loaded.
  • Mirror X/Y operations are correct and reversible.
  • Ctrl+Z / Ctrl+Shift+Z round-trip every operation cleanly.
  • Save → load round-trip preserves edited UVs through FBX and glTF.
  • Unit tests for each transform op + an undo round-trip test.
  • Sentry breadcrumb mesh.uv.transform recorded.

Effort

~5–6 days.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestuv-editorUV map editor and editing tools

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions