Commit Graph
566 Commits
Author SHA1 Message Date
chasse20 b5d9abbb91 Auto: Fix texture set resize ownership and reduce memory peaks
Reject resize results from another project. Release stale pixels and caches before retrying a resize within the original project, preserving intervening edits and one-step undo.

Fix rectangular height sampling, seam-boundary coverage, malformed set selectors and saved channel ordering. Reduce temporary composite and mesh-partition storage, and pack mixed-aspect trace textures without changing their samples.

Keep channel actions reachable in short windows, strengthen export and modal regressions, document the control commands and remove unrelated formatting changes.
2026-11-29 08:04:24 +00:00
Rebornim 41b8a69818 Merge upstream main into the texture sets pass
# Conflicts:
#	crates/formats/src/mesh_import/external.rs
#	crates/ui-egui/build.rs
#	crates/ui-egui/i18n_build.rs
#	crates/ui-egui/src/lib.rs
#	crates/ui-egui/src/menus.rs
#	crates/ui-egui/src/shelf.rs
#	crates/ui-egui/src/shelf_updates.rs
#	crates/ui-egui/tests/i18n_build.rs
#	crates/ui-egui/tests/it/shelf_updates.rs
2026-11-29 06:30:40 +00:00
Chris Hassebrook b65ef83c63 Merge pull request #223 from simonhull/fix/panic-safe-session-edit
Restore the document when a command panics mid-edit
2026-11-29 00:08:00 -05:00
Chris Hassebrook 8e6c845272 Merge pull request #206 from Silvertree2010/fix/201-launcher-install-texturecraft-ca
Find MaterialCraft in the sibling launcher install folder
2026-11-29 00:07:13 -05:00
SteamSmith 219b3490c8 Merge remote-tracking branch 'origin/main' into work/223 2026-11-28 21:06:32 -05:00
SteamSmithandClaude Sonnet 5.5 aabf1c06dc fix: a failed or panicking edit marks the restored document's tiles dirty again
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-28 20:55:04 -05:00
SteamSmith 5f116a74cf Merge remote-tracking branch 'origin/main' into review/206-fix
# Conflicts:
#	crates/engine/src/link_cmds.rs
2026-11-28 19:20:45 -05:00
Rebornim ea0cb24113 Merge upstream main into the texture sets pass 2026-11-29 00:20:33 +00:00
chasse20 b1a0944f89 Auto: Integrate main and resolve catalog embedding conflict
Preserve distinct-character collection for font subsetting alongside main's catalog accessor and compressed wasm embedding. Exercise the generated accessor with both populated and empty catalogs.
2026-11-28 19:13:49 +00:00
SteamSmithandClaude Sonnet 5.5 0097f99053 test(engine): edge cases for find_installed_tool (folder named like the tool, no parent, missing app folder)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-28 10:30:31 -05:00
chasse20 3b858f1a17 Auto: Integrate main with rectangular texture exports 2026-11-28 08:55:08 +00:00
chasse20 c6a8a86247 Merge reviewed target into TextureCraft rectangular textures 2026-11-28 08:38:21 +00:00
FredApps 2332602c4e web: embed fonts, catalogs, the icon font and the studio HDR deflated
The web build is under a 24 MiB download budget. Its embedded data is
now stored deflated and inflated once at startup: the craft-fonts faces,
the translation catalogs, the Phosphor icon font and the studio
environment HDR. egui's default faces come from craft-ui's deflated
copies instead of egui's default_fonts feature, and the engine's
built-in text fonts (Ubuntu Light, Hack) come from the same copies
through text_cmds::provide_built_in_fonts. Desktop builds are unchanged.
2026-11-28 15:37:56 +07:00
chasse20 31d1b7b241 Auto: Integrate main and honor brush preview channel toggles
Bring in main's project rename changes. Use the existing preview fallbacks for disabled Base Color, Metallic, and Roughness channels while preserving their values for re-enabling. Cover the rendered preview with a regression test.
2026-11-28 08:27:36 +00:00
chasse20 f2176331a0 Auto: Integrate main into Paint Properties
Preserve desktop autosave recovery and retain the package and cooked maps of linked materials used in effects. Keep both lockfile dependency entries and the approved Paint Properties changes.
2026-11-28 08:08:38 +00:00
chasse20 32c89f35f4 Auto: Integrate main and repair paint, asset, and export previews
Keep main's Assets, Export, and headless parity changes alongside the unified Paint Properties sheet. Preserve history on fully blocked strokes, release obsolete preview resources, and redraw brush and stencil pictures at the correct scale and placement.

Load visible thumbnails on demand, resize common custom previews from borrowed pixels, and release stale file textures and project notifications. Index favorite ranks per draw and remove unused resources without repeated library scans.

Preserve export folds across job startup. Share idle plans between the footer and file tree, borrow running-job plans, and avoid redundant label measurements and template copies. Collect distinct catalog characters before sorting them for font subsetting.

Repair the Assets snapshot setup, isolate saved-brush test files, and clarify affected code and regression fixtures.
2026-11-28 08:00:03 +00:00
chasse20 b955de0e4d Auto: Fix MaterialX filename collision test
Use a real duplicate texture path in the fixture so literal token substitution remains intact. Validate the engine integration suite with the updated main.
2026-11-28 07:31:51 +00:00
Chris Hassebrook 7f16522d87 Merge pull request #889 from Rebornim/fix/images-used-material-effects
Assets: Remove unused keeps the package and maps of a material linked in a content effect
2026-11-28 01:41:44 -05:00
chasse20 4c1d486fc4 Auto: Integrate main and fix rename validation and export naming
Preserve both branches’ engine tests. Validate the project name before applying other dialog settings, clear discarded text undo history, and keep an unsaved project’s autosave filename stable across renames.

Expand export tokens once, preserve literal text in names, and sanitize flat stems directly. Reuse the dialog’s name buffer and update the command documentation and generated headless parity report.
2026-11-28 06:39:00 +00:00
Chris Hassebrook d41cf01f7f Merge pull request #827 from Rebornim/feat/export-pass
Export pass: layered PSD, per-map size, shader settings, Esc, hover preview, look and spec-backed templates
2026-11-27 22:55:22 -05:00
Rebornim 31bf2a58ca Assets: Remove unused keeps the package and maps of a material linked in a content effect
images_used counted a linked material's package and cooked maps only on a fill layer, so
Remove unused dropped them (and a smart material left them out) when the link sat in a
content fill effect.
2026-11-28 02:33:59 +00:00
SteamSmithandClaude Sonnet 5.5 8c06badf77 fix(engine): find MaterialCraft in the launcher's sibling folder, tested in a temp dir
A pure find_installed_tool(app_dir, exe) is tested in a temp folder (sibling
found, beside-the-program wins, missing is None) instead of writing into target/.
The 'did not start' hints name the sibling folder; control-protocol.md lists the step.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-27 21:16:33 -05:00
Rebornim 7e0bd1e6a2 Assets: the refresh popup's tests move a rewritten file's time on
Main's Resources Updater counts an equal-size file whose modification
time didn't move as unchanged, so a rewrite in the same millisecond as
the import read as up to date and the test failed on the gate.
2026-11-28 00:33:49 +00:00
chasse20 091869033a Auto: Preflight export paths and label tiled atlas previews
Reject selections that use one output path as both a file and a folder before rendering or starting a desktop export. Expose tile metadata in export.plan and use it to label atlas previews, including ambiguous filenames.

Write quantized 8-bit PSD rows directly into the merged-image buffer. Cover path conflicts in both orders, partial desktop writes, and visible atlas captions with regression tests.
2026-11-28 00:21:21 +00:00
Rebornim 077ed13751 Merge main into feat/brush-props-pass 2026-11-28 00:16:41 +00:00
Rebornim 97bc67f943 Merge upstream main into feat/assets-pass-2
Main's Resources Updater replaces the shelf's own resource.update and
resource.reload: the shelf menu's Reload and the refresh popup's
updates now run main's resource.status and resource.update, and Show in
reads the project's saved source path. A renamed image keeps its source
record, so it still follows its file.
2026-11-28 00:01:03 +00:00
Rebornim 145a4db4ec Assets: renaming an image also moves a generator's texture, grunge, micro details and Grayscale Conversion image 2026-11-27 23:08:28 +00:00
Rebornim 41a7d1d8a6 Keep the texture set list's keys and Escape from the app's shortcuts
Escape drops a rename or description edit even once the window's cancel has taken it from egui's input. With the pointer over the list, F2 renames the selected set and Shift+F10 or the Menu key opens its menu instead of switching the viewers layout or the mode. Escape is no longer a painting cancel while a dialog is open, so the channels window closes on it. A texture set name over the length limit is refused for its length.
2026-11-27 23:04:35 +00:00
RebornimandClaude Opus 5.5 088a217d7b Merge main into feat/export-pass
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 23:00:30 +00:00
chasse20 b93c1a285d Merge validated target into TextureCraft bake review 2026-11-27 21:36:52 +00:00
chasse20 e274358a56 Auto: Integrate main and fix bake freshness and cancellation
Preserve Resources Updater links and bake provenance when replacing or clearing mesh maps. Keep unrelated maps on unchanged UV atlases, discard partial results from failed workers, and reject overflowing texture-set indices.

Track vertex colors, part assignments, tangent frames and the packed file used by material-color bakes. Share the common source fingerprint across each task's selected maps. Add reimport, cancellation and atlas regressions, update the control protocol, and clarify the affected code.
2026-11-27 21:00:57 +00:00
Chris Hassebrook 06a4758caa Merge pull request #880 from SteamSmith/fix/open-in-materialcraft-private-folder
Open in MaterialCraft stages its package in a private folder
2026-11-27 13:50:17 -05:00
Rebornim fe0208f5d3 Count no high part as unused while a set matching "Always" bakes from it, note the occlusion Rust Runoff reads, and keep the maps still queued when a bake is canceled 2026-11-27 09:13:54 +00:00
Rebornim 3c55965755 Set and report the Brush section's Projection settings through tool.brush
The Projection band's Angle fade from / to and Stamp depth rows had no
command behind them, and tool.brush took Size Space (screenSpace) without
reporting it, so an agent could neither set nor read what the panel shows.
tool.brush now takes angleFade [from, to] and stampDepth, refuses a
malformed angleFade before changing anything, and returns all three.
2026-11-27 08:34:42 +00:00
Rebornim 44dceb6059 Paint every brush tool's strokes through the stencil, set in a Stencil tab
The stencil now shapes Paint, Eraser, Smudge and Clone strokes as well as
Projection ones: its gray times its alpha masks the stroke, read from the
viewport's point of view, and the tool keeps painting its own material.
Only the Projection tool paints the image's colors. In the 2D view, where
the stencil isn't drawn, only the Projection tool uses it, as before. The
viewport shows the stencil and S + drag places it for every brush tool.

Every brush tool gets the Stencil tab. Its section is a slot showing the
stencil image (a click opens the picker of the project's textures with
Import... first, × takes the stencil away, an image dropped on it becomes
the stencil; the S-drag keys are its tooltip), a Tiling mode list (No
Tiling, H and V Tiling) with a picture per mode, Scale, Rotation and
Position X / Y stacked beside a picture of the view with the stencil
placed in it, and Overlay opacity. The STENCIL caption's reset puts the
stencil back in the middle of the view. The sliders change it through
tool.stencil.
2026-11-27 08:25:57 +00:00
Rebornim 2cf3d2ad67 Turn pen pressure on Size on and off from the Size row
BrushSettings gains size_pressure (on by default and for brushes saved
before it existed, so old projects paint as before). Off, a light pen
paints at full size in both views; tool.brush takes and reports
sizePressure. The Size band's rows keep a pen button slot, Minimum Size
greys while pressure is off, and the brush preview drops its pen taper.
2026-11-27 08:25:57 +00:00
Rebornim 5cfdfcd4ad Check the viewport padding rebuild on the ball's set that has texels past a seam 2026-11-27 08:17:02 +00:00
Rebornim 8dfe916224 Keep only the texels past a seam beside the island-edge padding, so padding across seams holds one full-size map instead of two 2026-11-27 07:33:26 +00:00
Rebornim fcd3644744 Put a blank line after the multi-line early-exit guards in the texture set code
Spacing only (CODE_STYLE: a blank line after a multi-line if/let-else guard), in methods this branch adds or changes.
2026-11-27 06:44:02 +00:00
Rebornim 8032697c99 Switch the channel off on the layer the Manage channels test reads
The test read the set's bottom layer but switched roughness off on the selected one, so it stopped at its own precondition instead of checking textureSet.channels.
2026-11-27 06:41:17 +00:00
Rebornim 7b370383f2 Test that a set's size, formats and settings survive save and reopen, and that older sets open as before
Two sets with different sizes, channel formats, added channels, mixing, height to normal, padding and a non-Latin description go through the project file and come back the same; a set without the new fields opens square, with 2D padding and Smooth height to normal.
2026-11-27 06:40:02 +00:00
Rebornim fd91866c47 Keep picked channel formats in a project template
A template saved the set's channel formats but not whether they were picked, so a project started from it stored every channel at 16 bits again while showing the formats as 16-bit. Templates now carry format_precision; older template files read it as false and keep 16 bits, as before.
2026-11-27 06:36:50 +00:00
Rebornim 544d788129 Keep a layer's switched-off channels when Manage channels applies to every set
With Apply to all Texture Sets the dialog sends every ticked channel, including the ones a set already has, and textureSet.channels added each again, which switched that channel back on in every layer of the set where it had been turned off. A channel the set already has is now left alone.
2026-11-27 06:34:20 +00:00
Rebornim 658cc2a168 Refuse a malformed texture set height or setting instead of ignoring it
textureSet.resolution took a height that was not a number as absent and resized the set square, and textureSet.settings skipped a normalMixing, aoMixing, heightToNormal or uvPadding value that was not a string and reported success. Both now return an error and leave the set as it was, as normalFormat already did.
2026-11-27 06:34:17 +00:00
Rebornim 3ff32d91cc Texture Set list rows: size and shader dropdowns per row, rename in place, a right-click menu, descriptions, and a UV tile set's tiles under it with their own size 2026-11-27 06:14:29 +00:00
Rebornim 8cb65c3c40 Manage channels: a dialog listing every channel by group, ticked when the set has it, applied in one undo step to this set or all sets 2026-11-27 06:14:29 +00:00
Rebornim 17923a7116 Channels: 19 more material channels and User0 to User31, stored and exported, with inspect marking the ones the shader ignores 2026-11-27 06:14:29 +00:00
Rebornim f2b8c0b2bd Channel storage format: set by command, and 8-bit and grey formats change what the composite holds
textureSet.channel.format {channel, format} stores a channel in sRGB8, L8, RGB8, L16, RGB16, L16F,
RGB16F, L32F or RGB32F, as one undo step. The composite keeps 256 steps for 8-bit formats (sRGB8
spaced for gamma) and one grey value for L formats; 16-bit and float formats keep the tiles' 16 bits,
and the command says so for floats. Layer data keeps its precision, so a wider format brings back
what was painted.

Until a format is set, every channel keeps the 16 bits TextureCraft always stored (shown as RGB16 /
L16), so new and saved projects render as before; setting one channel's format keeps the others at
16 bits.
2026-11-27 06:14:29 +00:00
Rebornim 138b4da099 Texture set size: width and height, so a set can be non-square, set by command and followed by the viewport, filters and export
textureSet.resolution takes an optional height (default: square). Old projects open
square as before; sets whose UV tiles have their own sizes stay square.
2026-11-27 06:14:29 +00:00
Rebornim 82e3e72201 Texture set UV padding: across seams (3D) or from island edges (2D), set by command and followed by the viewport and export
textureSet.settings takes uvPadding (3d or 2d) as one undo step and textureSet.inspect
reports it. Padding from island edges (2D) is the padding we always had: each texel
outside the UV islands repeats the nearest covered texel. Padding across seams (3D)
continues the surface across UV seams: a texel just outside a seam takes the texel as far
inside the seam's other island (UvSeam finds the edges two triangles share in 3D but not
in UV space), up to 32 texels out, and falls back to the nearest covered texel elsewhere.
Tangent-space normals always pad in 2D, since they turn with their island. New texture
sets pad across seams; projects without the field keep 2D, so they open and export as
before.
2026-11-27 06:14:10 +00:00