Skip to content

DRAFT: opt-in live PNG texture preview with bounded watcher (#252) - #7

Draft
JayceeB1 wants to merge 5 commits into
integration/artist-intent-core-2026-10-10from
integration/live-texture-2026-10-10
Draft

JayceeB1 wants to merge 5 commits into
integration/artist-intent-core-2026-10-10from
integration/live-texture-2026-10-10

Conversation

@JayceeB1

Copy link
Copy Markdown
Owner

Purpose

Experimental, opt-in second slice of upstream lightningpixel/modly#252, originally contributed by @OmarB97. Builds on our explicit Artist Context PR #6. Neither fork main nor upstream is changed.

User-visible behavior

The 3D viewer gets a Watch texture control. The OS file dialog selects a PNG. Saving the PNG in an external image editor updates a compatible single-texture model without re-importing its GLB. Invalid, partial and wrong-dimension saves show an error while preserving the previous appearance. Press Stop or close/switch the viewer to release watchers.

Differences from original draft

  • Bounded input: maximum 32 MiB PNG snapshots, fixed-size reads with file-size/mtime consistency checks, dimension cap 8192².
  • Scoped capability: renderer cannot specify arbitrary file paths; an OS-picked file is bound to the owning Electron webContents. Watchers clean up on owner destruction and app quit.
  • Safety: reject symlinked watched files and unsupported formats, debounce rename/save bursts, retry partial saves, and ignore stale revisions / async texture loads.
  • GPU lifecycle: restore original material maps on panel unmount, dispose replaced GPU textures only after updating references, and preserve original color space/filter/UV sampling rather than globally forcing pixelated textures.
  • Add watcher, preload/API and Three.js helper regression tests. Extend the staging CI to Linux and Windows for this branch.
  • Leave unrelated Carry artist intent through generated assets lightningpixel/modly#252 UI zoom and artist-intent automation changes out of this PR.

Validation

  • Changes isolated to a child branch stacked on DRAFT: explicit v1 Artist Context workflow node (first part of #252) #6.
  • Test cases added for corrupt/partial PNGs and recovery, watch stop, symlink/size/dimension limits, IPC scope, multiple materials and restoration.
  • Linux and Windows GitHub Actions full gates (running at PR creation).
  • Manual Windows Electron run with real Blender/Krita/GIMP external saves; check multiple model switches and GPU resource cleanup.
  • Review atomic-save handling, large images, PNG decoding and source-author attribution.

Full technical ledger: docs/experimental-live-texture.md.

Draft; do not merge or describe as a validated installer yet.

…ve recovery

Adapt OmarB97's watcher, cap reads to 32 MiB, guard symlinks and file changes, and add regression cases.
…ped preload API

Only OS-picked PNGs can be watched; lifecycle follows webContents, with bounded watcher and IPC contract test.
…leanup

Adapt upstream Three.js viewer workflow, preserve original sampling/filter settings, restore maps on unmount and check stale loads.
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