Commit Graph
97 Commits
Author SHA1 Message Date
Dylan M. TaylorandNetterSilver c60e3a1dae Map shared glTF PBR material data
Keep the fill layer and image conversion in TextureCraft while reading glTF material factors and embedded images from craft-mesh. This carries the engine feature from #296 and preserves its end-to-end test.

Co-authored-by: NetterSilver <133535268+Silvertree2010@users.noreply.github.com>
2026-11-12 08:49:21 +00:00
Dylan M. TaylorandNetterSilver c92e2138b7 Read OBJ and glTF through craft-mesh
Carry forward the bare material assignment behavior from #361 and consume the shared glTF image data for the high-poly base color map.

Co-authored-by: NetterSilver <133535268+Silvertree2010@users.noreply.github.com>
2026-11-12 08:42:40 +00:00
test-bit-sys 21856d7783 fix(formats): preserve existing OBJ UVs when only some objects lack UVs (#286) (#394)
Previously, if any object in an OBJ mesh lacked texture coordinates, all UVs across all objects were discarded and replaced with a full automatic unwrap.

Skip empty models without indices, preserve existing UVs on textured objects while assigning default UVs to untextured helper/sub-objects, and report a warning without forcing a full mesh unwrap.
2026-11-11 08:57:31 +01:00
chasse20 1c5ff6e5c3 Restore configurable project resource limits 2026-11-11 00:30:36 -05:00
vangel76andClaude Sonnet 5.5 6a6f2fd2ab Merge upstream/main into fix/save-over-load-limit
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 22:00:54 +01:00
chasse20 368731f7a4 Fix Clippy checks and clean up affected functions 2026-11-10 05:33:20 -05:00
chasse20 a5f09109ea Merge main into PR 234 2026-11-10 05:33:20 -05:00
vangel76 2b98204931 Merge remote-tracking branch 'origin/perf/parallel-project-save' into pr218-merge 2026-11-10 00:28:01 +01:00
vangel76 0ecfa244af amend 2026-11-10 00:20:01 +01:00
vangel76andClaude Sonnet 5.5 0ca220ed2d Merge branch 'perf/parallel-project-save' into fix/save-over-load-limit; no size limit on opening a project
The 8 GiB MAX_TOTAL guard on open and the save-side check are removed (maintainer
decision). The per-resource and mesh limits stay.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 00:14:07 +01:00
vangel76andClaude Sonnet 5.5 1a795584f1 perf(formats): cores kept for the UI and a RAM share for project saves are settings
The worker cap of 8 and the fixed 3 GiB in-flight budget are gone. Prefs gets
'cores kept for the UI' (default 1, 0 or more) and 'max RAM while saving'
(default 50% of the free RAM).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-10 00:06:01 +01:00
Chris Hassebrook be989fba6f Harden baked map imports and fix TGA decoding 2026-11-08 08:58:07 +00:00
vangel76 d8ecfb7d42 Merge upstream/main into fix/clippy-chunks-exact-to-as-chunks 2026-11-08 02:27:35 +01:00
vangel76andClaude Opus 5.5 8334230ed1 test(formats): a late entry error with all earlier entries fine is returned
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 02:23:52 +01:00
vangel76andClaude Sonnet 5.5 8eeb8e5e7e Name the exact byte counts in the too-large-to-save error
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 16:54:00 +01:00
chasse20 747068dbdf Fix bake settings and UV tile controls 2026-11-05 22:39:42 -05:00
vangel76andClaude Sonnet 5.5 8eb2c83e04 Restore #[test] attribute lost in merge
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 02:57:27 +01:00
vangel76andClaude Sonnet 5.5 dcb048b5b4 Merge upstream/main into fix/save-over-load-limit
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 02:52:41 +01:00
vangel76andClaude Sonnet 5.5 1f07beeb43 Drop unused Body import after merge
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 02:44:41 +01:00
vangel76andClaude Sonnet 5.5 d1fd8fd753 Merge upstream/main into perf/parallel-project-save
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 02:43:23 +01:00
chasse20 b978bc9525 Recover older project settings 2026-11-04 18:57:05 -05:00
vangel76andClaude Sonnet 5.5 81281c1a0a Merge upstream/main into fix/clippy-chunks-exact-to-as-chunks
Upstream removed bake/maps.rs, engine/tests/auto_rebake.rs and read_skew
(moved elsewhere); take the deletions. Convert two new chunks_exact uses in
bake/test/setting.rs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 00:06:23 +01:00
chasse20 18a3c98176 Implement clean-room bake settings and improve map accuracy 2026-11-04 03:57:46 -05:00
chasse20 e4405760f1 Major refactor of Bake Mode settings and some UI, lots of cleanup for parity 2026-11-04 02:15:08 -05:00
vangel76andClaude Sonnet 5.5 715baf4760 Use as_chunks where the chunk size is a constant
Clippy 1.99 flags chunks_exact and chunks_exact_mut with a constant
chunk size (chunks_exact_to_as_chunks). Switch those call sites to
as_chunks / as_chunks_mut. Behaviour is unchanged: the trailing partial
chunk was already dropped.

Fixes #233

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-04 01:36:12 +01:00
vangel76andClaude Sonnet 5.5 d7ae9891ef Parallel save: stream entries when no worker thread starts
Review point: with no worker thread the fallback built a whole in-memory zip per
entry; it now writes each entry straight into the file like the serial writer,
and the test covers that path.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-04 00:45:24 +01:00
vangel76andClaude Sonnet 5.5 b99ebf7321 Save size check: skip orphan baked sets, clearer message, wider test
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-03 22:17:57 +01:00
vangel76andClaude Sonnet 5.5 52505ecbc2 Refuse to save a project that could not be opened again
Opening a project file stops at 8 GiB of decompressed data (MAX_TOTAL), but
saving had no matching check, so a too big project saved fine and then failed
to open. Saving now counts the bytes the loader would count and refuses before
the temporary file is created, with an error that names the size and the limit;
the existing file stays as it was. The limit itself is unchanged. A test checks
that the count equals what load counts for a real file.

Fixes #215. Refs #200

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-03 22:17:06 +01:00
vangel76andClaude Sonnet 5.5 11d672661f Parallel save: fall back when threads cannot start; release entry share after copy
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-03 22:09:19 +01:00
vangel76andClaude Sonnet 5.5 07fec78a53 Compress project file entries on several threads
Saving compressed every zip entry one after the other with deflate level 6 on a
single thread; the baked maps were about three quarters of the time. The entries
are independent, so native builds now compress them on up to 8 worker threads
(one core is left to the UI) and copy the finished entries into the file in the
original order with raw_copy_file. Entry names, order, methods, CRCs and sizes
are unchanged, the format is unchanged, older versions open the files.

Memory stays bounded: a worker only starts an entry while the estimated size of
the entries started and not yet written is under 3 GiB, and baked maps and pixel
tiles stream into the compressor instead of building a raw copy first. wasm and
single-core machines keep the serial writer. The atomic tmp + fsync + rename
path is unchanged.

Refs #200, fixes #214

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-03 22:07:05 +01:00
Brandon Thomas f31e6e1078 Merge remote-tracking branch 'origin/main' into upd-166
# Conflicts:
#	crates/formats/src/mesh_import/tests.rs
2026-11-02 19:25:11 -05:00
Brandon Thomas 448c975412 Merge pull request #164 from Silvertree2010/fix/h5814-obj-export-writes-the-model-name
Keep OBJ and MTL header comments on one line
2026-11-02 19:25:01 -05:00
Brandon Thomas c6dbadee5a Merge pull request #163 from Silvertree2010/fix/h5835-ply-import-rejects-valid-files-w
Fix PLY import when face element precedes vertex element
2026-11-02 19:24:56 -05:00
Brandon Thomas f07930ca8b Merge pull request #151 from Silvertree2010/fix/h5395-export-fails-to-write-files-whos
Fix export failing for file names with a max-length stem
2026-11-02 19:24:52 -05:00
Brandon Thomas 0db4a0cdba Merge pull request #144 from Silvertree2010/fix/h5360-saving-a-project-fails-when-two
Make zip entry names unique when saving bake meshes and resources
2026-11-02 19:24:47 -05:00
BFlat 52c0fb3e5b Merge pull request #169 from storytold/export/obj-companion-stems
OBJ exports whose names sanitize alike keep their own MTL and maps
2026-11-02 22:00:13 +07:00
bflatastic 73031031a3 OBJ exports whose names sanitize alike keep their own MTL and maps
`ball 1.obj` and `ball_1.obj` sanitized to the same companion stem, so
exporting both into one folder overwrote each other's .mtl and textures. A
name the sanitizer changes now gets an FNV-1a hash of the original appended;
names that need no change keep their companions as before.
2026-11-02 21:25:46 +07:00
bflatastic 6dabe66324 Filter radii and height slopes follow each UV tile's own resolution
A UV tile with a lower resolution than its atlas block fills the block's
corner, so it has fewer texels per UV unit. Neighbourhood filters (blur,
sharpen, warps, bevel, glow, ...) and height-to-normal slopes used the block's
texel density for every tile, so such a tile blurred twice as wide and showed
twice as steep slopes in UV space.

TextureSet::block_scales gives each block's share; the compositor filters each
block at its tile's radius, texture export and the CPU path tracer scale the
slope by it, and the display packs it into the Extra texture's alpha for the
viewport and GPU path tracer shaders (parallax too).
2026-11-02 21:08:35 +07:00
NetterSilverandClaude Haiku 5.5 c233da2af7 Name unnamed OBJ parts after the file stem
Found while testing crates/formats/src/mesh_import/obj.rs:77 (model.name passed to raw.polygon); stem fallback in mesh_import/mod.rs `read`

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-02 14:52:17 +01:00
NetterSilverandClaude Haiku 5.5 b6aaf71920 Keep OBJ and MTL header comments on one line
Found while testing crates/formats/src/mesh_export.rs:24

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-02 14:48:09 +01:00
NetterSilverandClaude Haiku 5.5 6192315968 Fix PLY import when face element precedes vertex element
Found while testing crates/formats/src/mesh_import/ply.rs:164 (nverts is set at line 140)

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-02 14:21:40 +01:00
bflatastic 15a06149d7 OBJ companions are named after the OBJ; the implicit material exports; ids are unique ignoring case 2026-11-02 19:43:54 +07:00
bflatastic c14e500298 Exported material ids and map names stay unique when names collide 2026-11-02 19:06:49 +07:00
bflatastic 92e92ff779 OBJ export writes an MTL material library with each material's maps 2026-11-02 18:20:21 +07:00
NetterSilverandClaude Haiku 5.5 f8558a2f71 Fix export failing for file names with a max-length stem
Found while testing crates/formats/src/export/mod.rs:844 (name built at 476-478)

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-02 11:03:28 +00:00
BFlat 61637df84f Merge pull request #60 from SteamSmith/feat/bake-skew-correction
feat(bake): skew correction for high-poly transfer rays
2026-11-02 16:44:55 +07:00
bflatastic 360d70fcef Merge remote-tracking branch 'origin/main' into feat/bake-skew-correction 2026-11-02 16:10:38 +07:00
bflatastic 59a30187b5 fix(export): use is_multiple_of in the ICC profile writer (clippy -D warnings) 2026-11-02 16:09:01 +07:00
bflatastic d3453cd1f8 Merge remote-tracking branch 'origin/main' into feat/embed-colour-space 2026-11-02 15:59:33 +07:00
NetterSilverandClaude Haiku 5.5 383ce3e576 Make zip entry names unique when saving bake meshes and resources
Found while testing crates/formats/src/project_file/mod.rs:146-147 (also 180-181)

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-02 08:58:00 +00:00