Commit Graph
73 Commits
Author SHA1 Message Date
chasse20 cc6c6e3c63 Decode luminance EXR inputs with bounded float precision 2026-11-18 11:02:30 -05:00
chasse20 97f2e06ed5 Filter bilinear transforms at the selected mip level
Keep automatic and manual mip settings across SBS round trips and store each filtered reduction at the destination precision. Record the panorama, volume mask and Worley measurements that complete the 3D inventory section.
2026-11-17 23:45:47 -05:00
.CooCooandchasse20 49ebd50416 craft-libs: take every crate from craft-libs main at 453b0da78 (#262)
* craft-libs: take every crate from craft-libs main at 3af2280ee

The 15 craft-libs dependencies in the workspace Cargo.toml were pinned at
six different revs. They now all use 3af2280ee, the craft-libs main that
merged storytold/craft-libs#1337. Cargo.lock changes only the craft-libs
sources, and the two craft-xml entries become one.

* craft-libs: take every crate from craft-libs main at 453b0da78

Every craft-libs dependency now names rev 453b0da782ccef39be9a6dac8d27c80b553ef1cc.

- With one rev for every crate, craft-texture and the craft-texture-dds alias are the same
  package, which cargo does not allow under two names. materialcraft-formats now takes
  craft-texture with its dds feature, and dds_image.rs uses craft_texture paths.
- Cargo.lock comes from cargo update --workspace: only craft-libs sources change, the two
  craft-texture and two craft-xml entries become one each, and craft-dds is added as a
  dependency of craft-image-codecs.
- Updater::offer now opens the prompt at a later tick, after its own thread has inspected the
  install (storytold/craft-libs#1149). The update-prompt tests use a helper that offers and
  ticks until the prompt is open, and fails if the offer is declined.

* Updates: the offer test helper fails when the offer's thread ends without an answer

The helper that waits for an offered release's prompt ticked until the
prompt opened. When the offer's channel disconnects, the updater drops
the offer without a prompt (craft-update `updater.rs:606-610` at
453b0da78), so the helper kept ticking forever. It now runs each tick
through `Context::run_logic` and fails when a tick leaves no prompt, no
launcher choice and no repaint request, which the updater makes on
every tick while the offer waits for its thread.

* Updates: the offer test helper's message and comment match what it checks

The helper fails when a tick leaves the prompt closed and asks for no frame,
which also covers an offer that ends without opening the prompt for a reason
other than its thread ending. The failure message and the doc comment now say
that.

---------

Co-authored-by: chasse20 <chasse20@gmail.com>
2026-11-18 08:43:52 +07:00
chasse20 dcb5864647 Auto: Route displayed exports through commands and fix view handling
Use immutable shared display snapshots for PNG saving, OBJ export, and clipboard copying through engine commands and the control channel. Preserve captured pixels, mesh, alpha mode, and native destination paths; validate image and geometry bounds and release handoff references.

Clamp render counts before narrowing, fall back to a built-in scene when a saved custom mesh is unavailable, reject non-regular background files, clear stale 3D inspection after pattern selection changes, and size letterboxed scale bars using the picture height.

Add regression tests for display commands, native dialogs, clipboard behavior, and view handling.
2026-11-17 15:07:08 +00:00
chasse20 a4e0cca25e Auto: Update SBS library, evaluation, previews, and shared libraries
Expand the clean-room SBS library and resource handling, correct atomic and function evaluation behavior, and add regression coverage and parity documentation.

Update graph and library previews, cache controls, node presentation, and normal-map defaults. Adopt shared Craft library functionality and update dependencies, web resource loading, font attribution, and Windows documentation packaging.
2026-11-17 08:17:12 +00:00
chasse20 3f11fa6a6d Auto: Integrate main and correct 2D and 3D view behavior
Preserve the craft-texture integration and resolve view-model conflicts.
Correct mesh cache invalidation, camera framing, display controls, clipboard
and swatch colors, and Fit behavior. Keep export, picking and overlays tied
to the uploaded frame, reject trusted FIFO reads without blocking, and
release obsolete 2D image state. Report snapshot timeouts explicitly.

Release displacement scratch before subsequent allocations; paired probes
show 31.6-34.4% lower tracked temporary payload peaks when generating
normals. Split new render types and complete scoped style cleanup.

Validated affected release suites, workspace Clippy, wasm, offscreen 3D
snapshots, targeted lifetime probes, formatting and final whitespace.
2026-11-17 07:38:31 +00:00
FredApps 8f7da6268e Pin texture dependency group to merged shared revision 2026-11-17 06:14:42 +01:00
chasse20 4b5c27188c Auto: Fix HDR mipmaps and reuse image processing buffers
Prevent overflow in nearest-filter mipmaps and retain regression coverage. Reuse pattern, precision, channel and blur buffers. Wait for asynchronous parameter cooks in snapshot tests. Complete scoped cleanup and remove confirmed unused dependencies. Validated affected release suites, Clippy, layering, wasm, hostile-input checks and all 43 offscreen snapshots.
2026-11-17 03:28:21 +00:00
dotCooCoo 2ee4537c65 Merge main into feat/image-craft-texture 2026-11-16 16:45:08 -08:00
FredApps e9b270eb94 web: ship the SBS library's bitmaps beside the wasm, not inside it (#263)
* web: ship the SBS library's bitmaps beside the wasm, not inside it

The SBS library import (#219) embeds every file under assets/sbs into
every build, the browser one included. Its resources/ bitmaps are already
compressed PNG/EXR/BMP (14.1 MB, deflate saves 1%), and with them the
release wasm grew from 14.3 MB to 33.3 MB, past the 24 MiB gate in
packaging/web/package.sh that guards Cloudflare Pages' 25 MiB file cap.
The nightly Release dry run has failed on Web (wasm) since.

For wasm32 the formats build script now leaves resources/ out of the
embedded library and lists it as EXTERNAL_ASSETS. index.html copies
assets/sbs/resources to sbs/resources in the dist, and the web app
downloads those files at startup (in parallel, before the session is
created) and hands them to library::install, so library::read serves
them as before. A failed download is logged and surfaces as a missing
asset on the nodes that use it; startup goes on. Native builds still
embed everything.

* web: bound the startup download of the library resources

A response that sends headers and then stalls would keep download_library,
and with it the loading screen, pending for good. One AbortController now
covers every request and body, aborted after two minutes; whatever is still
pending fails, is logged, and startup goes on without it.
2026-11-16 22:12:24 +01:00
FredApps 0708c4d9d8 Merge remote-tracking branch 'origin/main' into onee/778-craft-mesh
# Conflicts:
#	Cargo.lock
2026-11-16 12:38:46 +01:00
dotCooCoo caf79e955f Merge main into feat/image-craft-texture 2026-11-16 03:23:48 -08:00
FredApps c3860d2300 formats: read 3D-view meshes through craft-mesh
OBJ and glTF/GLB meshes for the 3D view now come from craft-mesh's obj and
gltf readers (craft-libs main 57288eda) instead of the tobj and gltf crates.
Meshes are placed with Scene::instances, so a mesh under a transformed parent
node takes its parent's transform. Normalisation, box UVs, tangents and the
vertex/triangle limits stay in the app.

Refs storytold/craft-libs#778
2026-11-16 11:24:49 +01:00
FredApps e25de7b9a8 #789: read SVG resources through craft-svg's bounded tree and draw
The SVG node's resources were parsed and drawn with a direct usvg/resvg 0.47
dependency, so a hostile file could expand entities, nest past the stack or
allocate layers without a bound. Parsing now goes through craft_svg::tree
(preflight on bytes, SVGZ, entities, attributes and nesting; an image resolver
that never reads linked files and bounds embedded images) and drawing through
craft_svg::tree::draw::render, which refuses a drawing whose buffers would
exceed 1 GiB. The direct resvg dependency is removed.

Part of storytold/craft-libs#778 and storytold/craft-libs#789.
2026-11-16 11:11:35 +01:00
dotCooCoo d82c730b98 Merge main into feat/image-craft-texture 2026-11-15 22:51:27 -08:00
FredApps fa58e0b8af Merge main into refactor/shared-sbs-base64 2026-11-16 06:47:27 +01:00
dotCooCoo 542cb68fea Merge main into feat/image-craft-texture 2026-11-15 17:02:18 -08:00
FredApps 3cd7d04743 Merge remote-tracking branch 'origin/main' into w254
# Conflicts:
#	Cargo.lock
#	Cargo.toml
2026-11-16 01:06:53 +01:00
dotCooCoo 7742002746 Merge main into feat/image-craft-texture 2026-11-15 15:55:02 -08:00
Dylan M. Taylor 271890af61 Merge pull request #253 from storytold/extract/shared-format-codec
Reuse shared XML escaping for SBS attributes
2026-11-15 18:04:47 -05:00
Dylan M. Taylor faa78d4175 Reuse shared Base64 output for SBS embedded resources 2026-11-15 14:26:33 -05:00
Dylan M. Taylor c0d8e921eb Use shared DDS float surface decoder
Keep original MaterialCraft transfer and first-surface policy; move backend access and checked allocation to craft-texture.
2026-11-15 14:00:31 -05:00
dotCooCoo bee8c3feb8 Merge main into feat/image-craft-texture
main's per-axis wrapping, stored sampling and integer-sampling flag now
come from craft-texture (storytold/craft-libs#1709). Every craft-libs
dependency is pinned to that pull request's head, 92fb3fa8.
2026-11-15 10:48:09 -08:00
FredApps 6c3b35c396 Merge pull request #219 from storytold/191-sbs-based-node-imports
SBS Based Node Imports
2026-11-15 18:59:42 +01:00
dotCooCoo e6b0429652 Merge main into feat/image-craft-texture 2026-11-15 09:28:48 -08:00
Dylan M. Taylor 5cf55f805c Keep shared XML lockfile entry in Cargo order 2026-11-15 11:44:04 -05:00
FredApps ed08636c7c Merge main shared material archive integration 2026-11-15 17:27:13 +01:00
Dylan M. Taylor fd0f4bd4c1 Reuse shared XML escaping for SBS attributes 2026-11-15 11:08:29 -05:00
Dylan M. Taylor 3e361b2af5 Adopt shared ZIP64 entry-count guard fix 2026-11-15 15:47:19 +00:00
dotCooCoo 3ef47a1dff Merge main into feat/image-craft-texture 2026-11-15 06:09:37 -08:00
Dylan M. Taylor 5d7dcd8029 Pin merged shared material format 2026-11-15 13:08:27 +00:00
Dylan M. Taylor 01f0c70648 Use bounded portable material detection 2026-11-15 11:39:50 +00:00
Dylan M. Taylor f4e079b49d Use shared portable material archive 2026-11-15 11:36:22 +00:00
PiJellyPin 83b777486c 3D view update 2026-11-15 12:20:56 +01:00
dotCooCoo 9744afda83 Image: use craft-texture's image planes and sampling
Replace the local materialcraft-image crate with craft-texture from
storytold/craft-libs (storytold/craft-libs#1216), with its parallel
feature on. engine re-exports it as `engine::image`. Every craft-libs
dependency moves to the same revision, 29fb8f8e.

The image fields are private in craft-texture. Callers read them through
width(), height(), kind() and data(), and decoders, the pixel processor
and the pattern raster build images with Image::from_data, which rejects
an empty size or a buffer of the wrong length with an error.

This changes some pixels at the edges of the float range:
- a repeated sample far from the origin keeps its phase instead of
  stopping at a clamped texel position
- generate_uv spreads its coordinates over the clamped size
- bilinear samples and box downsampling of values near f32::MAX stay
  finite
- linear_to_srgb(NaN) returns NaN instead of -0.055

The box blur's running sum in nodes/src/ops.rs now uses f64 as well,
so a blur of values near f32::MAX no longer overflows.

#225 fixes the generate_uv fault in the local crate; craft-texture
includes that fix.
2026-11-14 15:59:55 -08:00
chasse20 e9b777bee2 CPR review #1 2026-11-14 03:45:23 +00:00
chasse20 8737d45b64 Use shared Liberation fallback for clean-room SBS assets
Preserve available user fonts and use craft-fonts Liberation Mono only when font data is missing. Keep original identifiers and retain repairable references if the fallback is unavailable.

Attribute the bundled clean-room SBS library, remove the bundled font binary, and share documentation and license staging across Windows MSI and portable packages.
2026-11-13 17:00:24 -05:00
chasse20 2318d25a3a Improve clean-room SBS evaluation parity 2026-11-13 11:46:15 -05:00
chasse20 db0baa1c2d Persist library previews in a bounded platform cache 2026-11-12 19:43:34 -05:00
Chris Hassebrook c5a4e4f22c Merge pull request #202 from dotCooCoo/chore/craft-update-6e03f65
Updates: take craft-update from craft-libs main at 6e03f65bf
2026-11-11 16:33:09 -05:00
Dylan M. Taylor c0a5a70d4a chore: bump version to 0.4.1 for the Flatpak update fix (#207) 2026-11-11 14:55:58 -05:00
Dylan M. Taylor 49bc10d11f Updates: take craft-update from craft-libs main at 6e03f65bf 2026-11-11 12:44:46 -05:00
dotCooCoo d6a1ff0bc7 Updates: take craft-update from craft-libs main at 6e03f65bf 2026-11-11 09:18:39 -08:00
FredApps a3167cc6ec Release: MaterialCraft v0.4.0 (#199)
* Release: MaterialCraft v0.4.0

* Release: the bundled function library's export metadata names 0.4.0
2026-11-11 16:35:45 +01:00
chasse20 85e0bf9247 Add parameter-owned function graphs 2026-11-10 04:07:54 -05:00
chasse20 535d83eaf4 Merge main and preserve project dialogs with shared UI 2026-11-09 02:00:54 -05:00
dotCooCoo 472d73eb87 feat(ui): move window, dialogs, shortcuts and quit to the shared crates
Bump craft-ui to craft-libs 1b34eba and add craft-keymap, craft-dialogs,
craft-quit, craft-menu (macOS) and craft-window.

File dialogs no longer block the event loop. Shortcuts dispatch through
craft-keymap and match exactly their modifiers. On macOS, Quit asks about
unsaved work and the app quits through the platform. On a Wayland desktop
that leaves the frame to the app, the menu bar is the title bar.
2026-11-08 21:41:59 -08:00
chasse20 f5dfa3f2a5 Merge main into package formats branch 2026-11-09 00:26:53 -05:00
dotCooCoo d23d6c76f1 feat(ui): check for new releases and update the app from inside it
Add Help > Check for updates... (ui.help.checkForUpdates), a check at
startup, the update prompt and result dialog from craft-update, and the
Windows update helper entry point.

A copy of the app downloaded directly was never told about a new version.
Runs driven by --control or MATERIALCRAFT_NO_PREFS skip the startup check.
Shortcuts wait while the prompt or a modal result dialog is open. The
update code builds on desktop only; the web build is unchanged.
2026-11-08 20:25:11 -08:00
chasse20 cc052aeaa8 Support SBS resources and independent MCRAFT packages 2026-11-08 22:10:35 -05:00