Skip to content

Image editor: slim down to image-loading; park legacy UV editor#24

Open
joeedh wants to merge 1 commit into
masterfrom
image-editor-sculptcore-cleanup
Open

Image editor: slim down to image-loading; park legacy UV editor#24
joeedh wants to merge 1 commit into
masterfrom
image-editor-sculptcore-cleanup

Conversation

@joeedh
Copy link
Copy Markdown
Owner

@joeedh joeedh commented Jun 2, 2026

Summary

The image editor fused two concerns — loading/displaying images and a full UV editor (the UVEditor UIBase component, UV picking, select/transform/flag ToolOps, and the unwrap-tools sidebar). To support sculptcore and a forthcoming UV-editing abstraction, this splits them apart and reduces the editor to a single responsibility: loading images into ImageBlocks and displaying the active one.

Changes

  • Parked the legacy implementation (unwired) under scripts/editors/image/pending-port/: ImageEditor.ts, uv_ops.js, uv_selectops.js, uv_transformops.js, plus a detailed TODO.md port checklist. Nothing imports them, so they fall out of the TS module graph (tsconfig.json uses files, not a glob) and are neither typechecked nor bundled.
    • ImageBus.ts stays at its original location — it's a cross-cutting bus token still imported by the mesh addon's unwrapper and re-exported from @framework/api. The new editor simply doesn't subscribe (seam-line triggers become harmless no-ops).
  • New minimal ImageEditor.ts (~365 lines): image.open() menu + Ctrl+O + a DataBlockBrowser; displays the active image with a checker background + textured quad and pan/zoom (VelPan + wheel). Owns the ImageUser directly, so the active image now lives at imageEditor.imageUser.image (was imageEditor.uvEditor.imageUser.image).
  • Updated/decoupled cross-layer consumers:
    • scripts/core/context.tsactiveTexture reads editor.imageUser.image.
    • scripts/image/image_ops.jsdataPath default → imageEditor.imageUser.
    • addons/builtin/mesh/src/mesh_uvops_base.ts — stops reaching into editor.uvEditor; defaults selectedFacesOnly = true until the new UV layer restores a real binding.
    • Regenerated the datapath catalog (pnpm gen:paths); updated documentation/editors.md.

Tool paths that were registered as a side effect of the old files (uveditor.*, image.set_type) are intentionally no longer registered — see pending-port/TODO.md. The mesh-addon unwrap/relax/pack ToolOps are unaffected (they live in the mesh addon); they just lose their image-editor UI surface for now.

Follow-up

A new UV-editing abstraction layer will be designed in a separate plan and will replace pending-port/. The checklist (decouple UV display/edit from the Mesh addon, restore selectedFacesOnly, replace the window.redraw_uveditors global with a bus signal, relocate image.set_type) lives in scripts/editors/image/pending-port/TODO.md.

Verification

  • pnpm build succeeds.
  • npx tsgo --noEmit: zero new errors in any touched file (the 108 reported are all pre-existing baseline files — pbvh_sculptops.ts, subsurf_mesh.ts, sculptcore node-types, etc.).

🤖 Generated with Claude Code

The image editor fused two concerns: loading/displaying images and a full
UV editor (UVEditor component, UV picking, select/transform/flag ToolOps,
unwrap tools sidebar). To support sculptcore and a future UV-editing
abstraction, split them apart.

- Park the legacy implementation, unwired, under
  scripts/editors/image/pending-port/ (ImageEditor.ts, uv_ops.js,
  uv_selectops.js, uv_transformops.js) with a TODO.md port checklist.
  Nothing imports them, so they fall out of the TS module graph (tsconfig
  uses `files`) and are neither typechecked nor bundled. ImageBus.ts stays
  put: it is a cross-cutting bus token still used by the mesh unwrapper.

- New minimal ImageEditor: loads images into ImageBlocks (image.open(),
  Ctrl+O, DataBlockBrowser) and displays the active image with a checker
  background + textured quad and pan/zoom. Owns the ImageUser directly, so
  the active image now lives at `imageEditor.imageUser.image` (was
  `imageEditor.uvEditor.imageUser.image`).

- Update cross-layer consumers to the new path / decouple them:
  context.activeTexture, image_ops.js dataPath default, and
  mesh_uvops_base.ts (stops reaching into editor.uvEditor; defaults
  selectedFacesOnly=true until the new UV layer restores a binding).
  Regenerate the datapath catalog and update documentation/editors.md.

A new UV-editing abstraction layer will be designed in a follow-up plan;
see scripts/editors/image/pending-port/TODO.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@joeedh joeedh force-pushed the image-editor-sculptcore-cleanup branch from f0431c9 to eaff69a Compare June 3, 2026 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant