Commit Graph
504 Commits
Author SHA1 Message Date
a2andClaude Sonnet 5.5 beea46c9e2 fix(engine): Open in MaterialCraft stages its package in a private folder
The button wrote <temp>/<name>.mcraft with a plain fs::write. On a shared temp
folder another local user could plant a file or link at that guessable name
first, and the write went through it. The package now goes into a new random
folder made exclusively (0700 on Unix), as a create_new file; folders over a
week old are swept.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-26 21:00:18 -05:00
aiongg d6dfd69bcd Merge pull request #850 from Ap3pp3rs94/feat/mesh-export-recompute-normals
feat(mesh): make normal recomputation a real export option
2026-11-26 18:01:18 -05:00
test-bit-sys 5ddec31f80 fix(engine): inspect direction on earlier-model generators (#873) 2026-11-26 21:56:27 +00:00
ATOM 0fbfec1c3d fix(mesh): weld recomputed normals and make export opt-in 2026-11-26 10:36:05 -06:00
chasse20 ae51095d55 Auto: Integrate main and bind save completion to its project
Preserve rebuilt UVs, undoable bake meshes and the shared window-close path. Keep each close and save dialog with its requesting project, wait for pending writes before restart, and leave already saved edits clean after a later stroke is canceled.

Capture archive inputs once, share encoded mesh buffers and release parsed bake geometry before writing. Split the new save types into dedicated files and cover project replacement, restart eligibility and snapshot lifetimes with regressions.
2026-11-26 15:09:23 +00:00
Chris Hassebrook d422c821f2 Merge pull request #772 from vangel76/fix/effect-stacks-769
Toggle material and mask effects from their thumbnails
2026-11-26 06:36:38 -05:00
autocraft-bot[bot] 6a3b3c1ba0 Merge main into feat/mesh-export-recompute-normals 2026-11-26 07:13:22 +00:00
ATOM 8700efc30c feat(mesh): make normal recomputation a real export option 2026-11-25 22:45:46 -06:00
chasse20 499591c387 Auto: Integrate main and protect effect names on reopen and undo
Discard pending names when their project or effect disappears, including while the Layers panel is hidden. Cover File Open and removal followed by undo in the UI tests.

Reuse effect slices and label layouts. Skip checkerboards and placeholder meshes for fully clipped thumbnails.
2026-11-26 04:35:45 +00:00
chasse20 d0b1c7e3ac Auto: Integrate main and fix warp placement, resets and stale drags
Preserve main’s perspective ring fit and use the displayed radius when deciding whether a ring can be grabbed. Keep surface placement on the edited fill’s texture set and end captured drags when the loaded mesh or projection changes.

Preserve toolbar settings across layout changes, honor Ctrl snapping, and expose the manipulator settings as keyboard-adjustable sliders. Reset stored projector rotation and scale when keeping corners, and reject invalid reset arguments before editing.

Skip hidden handle geometry, reuse projected axes, and remove temporary selection and hit-test vectors.
2026-11-26 04:13:53 +00:00
FredApps 9e0e971c47 Merge main into texture effect-stack disclosure 2026-11-26 03:18:39 +01:00
skylar taylor-barrick dc2c80739b Bake on the CPU under coverage so the Sonar shards stop crashing at exit (#840)
Merged under Skylar's explicit override (Nightly 792) after green CI, CodeRabbit on this head with no open threads, and an independent adversarial review with no blockers.
2026-11-25 20:02:16 -06:00
Chris Hassebrook bbd680686e Merge pull request #841 from vangel76/feat/mask-toggle-776
Switch a mask on or off with Shift+click, and leave mask view from the material thumbnail
2026-11-25 21:00:37 -05:00
Chris Hassebrook 1abfa79a89 Merge pull request #748 from vangel76/feat/uv-unwrap-on-import
Allow rebuilding mesh UVs in New Project
2026-11-25 20:43:13 -05:00
chasse20 21b86d98f6 Auto: Validate rebuilt UV layouts and trim save and reload allocations
Integrate main's dialog and bake-state changes. Reject inconsistent saved layouts at archive and session boundaries, and preserve vertex splits between independently packed materials.

Stream UV coordinates in bounded batches, transfer stored mesh bytes on successful reopen or reimport, and skip import reports that those callers discard. Set the archive version on the owned save snapshot to avoid copying the layer graph twice.

Cover material boundaries, malformed snapshots, locked coordinates and keyboard activation. Update the format and command documentation.
2026-11-26 01:03:44 +00:00
chasse20 940a526539 Auto: Integrate main and preserve mask toggle targeting
Allow Shift-click to toggle an explicit layer without selecting it. Keep the argument-free shortcut inactive when selection is empty. Focus the toggled thumbnail and expose its translated on or off state.

Build the export preset filename lookup once per unique save and preserve filename-alias handling.
2026-11-26 00:59:41 +00:00
chasse20 b7abae10d7 Auto: Integrate main and strengthen camera target regression tests
Resolve the view-command imports so main's environment lighting and the shared target parser both compile. Clarify the command help, parse each camera angle once, and name the existing camera bounds.

Cover the complete pose and revision on rejection, and verify that omitted and null targets preserve the pivot while other settings change.
2026-11-26 00:42:41 +00:00
Chris Hassebrook cd4e296743 Merge pull request #738 from MMexicann/patch-4
Reject invalid export preset save options
2026-11-25 18:43:18 -05:00
Chris Hassebrook d3f02c6e07 Merge pull request #744 from MMexicann/patch-8
Keep the current view when camera selection is invalid
2026-11-25 18:39:08 -05:00
chasse20 2f118603bf Auto: Integrate main and prevent unique saves from replacing presets
Validate save options before decoding preset maps. Select the replacement slot from the caller's rename intent and reject a full-library append before searching for a suffix. Keep explicit renames available at capacity and return an error if no unique name is available.

Avoid temporary name copies on replacement and add a regression for maximum-length names that collide after suffix truncation.
2026-11-25 23:13:08 +00:00
chasse20 e1f73ba237 Auto: Integrate main and release text buffers before image import
Keep the generated filename regressions independent for text-derived and explicit labels. Release owned font bytes after rendering and coverage after PNG encoding to reduce peak heap during import.
2026-11-25 22:46:05 +00:00
chasse20 a24bce1b3b Auto: Integrate main and reject malformed camera arguments
Integrate main at 2d86cc04. Reject top-level arrays and scalars before camera.select can reframe the mesh. Clarify intentional default selection in command help and extend the regression to verify the saved pose, bookmark, and revision.
2026-11-25 22:38:11 +00:00
vangel76 b3135dfaa2 Add a warp tool bar to the top bar
While the selected fill projects through a warp, the top tool bar shows
warp controls in place of the tool's own: transform tool settings
(manipulator size, grid and angle steps), warp mode list, gizmo modes
(move, rotate, scale, place on surface), object or world space, mirrors
and resets. The frame gizmo shows only the handles of the chosen mode and
snaps moves and turns to the steps while Ctrl is held. Reset frame takes
keepCorners to restore the frame alone.
2026-11-25 22:11:59 +01:00
Chris Hassebrook 2d86cc04ba Merge pull request #799 from Rebornim/feat/bake-pass-2
Bake mode pass 2: settings layout, bakers list, sync, automatic cage and map preview
2026-11-25 15:34:55 -05:00
chasse20 54ae40b14a Auto: Integrate main and fix bake selection and preview lifetimes
Validate every selected texture set before starting a real or quick bake. Apply linked settings atomically, reject invalid copy selectors, and preserve only the maps needed by a display preview.

Reuse fitted geometry across streamed maps, bound cage projection scratch, and stop discarded work. Release stale scene and thumbnail resources on project replacement. Keep pending imports safe across updates and restore keyboard focus after bake menus and dialogs close.

Add regressions for selection, cancellation, project replacement, and keyboard navigation. Retain main's packaging, dependency, and export changes.
2026-11-25 19:55:33 +00:00
chasse20 fc04f96857 Auto: Integrate main and fix generator masks, caches and previews
Resolve Micro Height against the requested draw and current atlas layout. Invalidate whole-map fields after geometry edits, reuse admitted fields across tiles, and stop rust runoff at gaps between UV islands.

Render configured preview inputs, cancel evicted image requests, and clear stale previews and point picks when the project changes. Reduce temporary curvature fields and repeated occlusion sampling work.

Preserve generator IDs and saved values while updating picker wording. Consolidate generator regression tests and credit the Nightly icon set inherited from main.
2026-11-25 19:25:49 +00:00
Rebornim 30dcceb3ef Generators: mask comparisons in tests reject missing texels; the micro blur's kernel is sampled once per pass
bake_resolution checks the mask's length again (the zip let a short or
empty mask pass), as do the texture and section test helpers.
2026-11-25 07:16:06 +00:00
Rebornim 333605327e Generators: a micro detail saved before Micro Details renders as saved while its generator stays on the earlier model
MicroDetails.earlier marks a migrated {anchor, amount}: an earlier-model
generator adds the anchor's height times the amount to its signal as #395
did; microAnchor/microAmount keep that reading on the earlier model, and
any Micro Details control moves the generator onto the reference's
controls and the anchor's curvature.
2026-11-25 06:57:21 +00:00
Rebornim e0c4fc49e9 Map-alone bake test: clear the colours the sample read when it baked 2026-11-25 02:36:37 +00:00
Rebornim 1d7669c038 Bake mode pass 2: synced sets check only that their values agree
The edited set's checks already bound every value it changes, so a legacy value it may keep (flat parameters, presets) also reaches the sets sharing it; a synced set is refused only when a copied value clashes with its own, such as a minimum above its maximum. Also fixes the new tests' sample resolution and a clippy lint
2026-11-25 02:22:41 +00:00
Rebornim a7e15a489c Generators: preview review round (pictures of any removed generator dropped, a test for the orb's restored images, imports) 2026-11-25 02:21:07 +00:00
Rebornim 3ec569def7 Generators: review fixes for the previews (an image read twice goes once and the orb gets its own back, pictures of a deleted generator dropped) 2026-11-25 02:18:40 +00:00
Rebornim d9f43048c5 Bake mode pass 2: review fixes, critic round 1
- Partner validation skips the edited sets and is set apart by blank lines
- A drag whose pointer left the window starts a new line on its return
- Tests for a legacy preset on synced sets and for each sync source rule
2026-11-25 02:02:05 +00:00
Rebornim 582c6853b5 Bake mode pass 2: review fixes
- Automatic cage: coincident vertices of different mesh-name groups keep separate distances
- A sync edit fails, changing no set, when a partner's merged settings would be invalid
- A high poly read during a paint stroke is added once the stroke ends, so its cancel or undo keeps it
- Quick bake and the map preview read the low poly's colours for the requested map even when it is unchecked
- The set picker's differing-values note compares with the set bake.sync will take settings from
- Map thumbnails redraw when the UV tiles' scales change
- Checkbox drags start on the primary button only and reach rows crossed between two frames
- A long texture set name or folder is cut to fit its row
- Map preview tests require a new picture, not just a missing one
2026-11-25 01:57:26 +00:00
vangel76 8f60ded96f Save the rebuilt UV layout in the project file
A project with rebuilt mesh UVs now stores the UV of every triangle
corner in uv_layout.bin. Reopening and reimporting the project's own
mesh apply that layout instead of running the unwrapper again, so a
later unwrapper change cannot move saved paint. A format 4 project
with rebuilt UVs but no valid layout is refused.
2026-11-25 00:42:46 +01:00
vangel76 65bd175d05 Merge upstream main into fix/725-background-project-save 2026-11-24 22:57:52 +01:00
Rebornim 623bd9008d Bake mode pass 2: map preview on the model while a map's settings show 2026-11-24 14:32:46 +00:00
Rebornim 3f72b65487 Bake mode pass 2: settings sync between texture sets, undoable high polys loaded on a worker, automatic cage, panels in the reference's layout 2026-11-24 14:32:46 +00:00
Rebornim 21b5180dc2 Generators: Use Texture goes along when the kind changes between the four kinds that have it 2026-11-24 13:14:07 +00:00
Rebornim 0402ba32a5 Generators: the panel's preview shows the generator as set, rendered one at a time while its settings change 2026-11-24 12:49:45 +00:00
Rebornim 9519f35873 Generators: second review round (one box radius formula, named cache key fields, tests for inspect and a half-given pick pixel) 2026-11-24 12:37:03 +00:00
Rebornim 1ed1f5ca5d Generators: review fixes (one type per file, a stale point pick drops, an image still loading blends black on both render paths, inspect reports the new controls) 2026-11-24 12:31:47 +00:00
Rebornim cb0a6f8a28 Generators: names and comments to the review guidelines; the bake hint without a hardcoded shortcut 2026-11-24 12:11:24 +00:00
Rebornim b40f743878 Generators: the seven new kinds in the picker with their panels, gradient stop places for UV Random Color and picking a point on the mesh 2026-11-24 12:09:45 +00:00
Rebornim 90d1c3e738 Generators: every generator panel on the property sheet, as the approved mockups 2026-11-24 12:09:44 +00:00
Rebornim f3d5cbe40c Generators: UV Checker, a checker and grid over each UV tile with the islands' borders
A new kind with the reference's controls: Seed, Checker Color Mode (Uniform, or Random per UV island), Checker Color, Checker Grid Tile, Checker Grid Opacity, UV Borders Color and UV Borders Width. Fitted to the reference's color captures: four checker squares per grid tile, dark squares a shade of the light color; minor grid lines every quarter square and major ones on the square edges, each layer laid over the last at the grid opacity; texels within the border width (0.2 is 3 texels at 2K) of an island's edge take the border color; random mode gives each island its own light color; the mask reads the mean of the sRGB-encoded channels, as the reference does. On the test gun 99.9% of texels match the reference within 1/255, at the default and with the grid off (the rest lie on seams where two islands touch in UV, which coverage alone can't tell apart). Lines and borders test a texel's whole footprint, so they stay visible below 2K. Commands only.
2026-11-24 12:09:41 +00:00
Rebornim 44a8af0943 Generators: UV Random Color, one random value per UV island
A new kind with the reference's controls: Seed and Color Source Mode (Random, or Custom Gradient with its colors). Each UV island (triangles joined across shared UV edges, as polygon fill groups them) gets a seeded random color, or the gradient's color at a random point, and the mask reads the mean of its channels. The reference's random numbers are its own, so islands differ in value but not in kind: on the test gun every island is one flat value in both, with island means spread alike (0.52 ± 0.16 against the reference's 0.50 ± 0.15). As a mask it is gray; a colored fill would need generators in content stacks. Generator maps now hold one whole-map field for UV Border Distance, Dripping Rust and UV Random Color. Commands only.
2026-11-24 12:09:41 +00:00
Rebornim 59fd1bc705 Polygon fill: the triangle grouping moves to geom, for generators to share
TrianglePartition and the UV edge key (with its corner grid) move from the engine into texturecraft-geom unchanged, beside the mesh they group, with a uv_islands constructor polygon fill now uses for its UV island mode. The compositor can then group texels by UV island for the UV island generators without depending on the engine.
2026-11-24 12:09:41 +00:00
Rebornim f3c8103579 Generators: Dripping Rust, rust grown from the occlusion and run down in drips
A new kind with the reference's controls: Rust Spreading, Rust Contrast, Spreading Smoothness, Drips Intensity, Drips Smoothness, Drips Samples Amount, Position axis, Seed and Invert. Fitted to the reference: the rust rises with the occlusion, is blurred by the spreading smoothness, and each texel then takes the most rust found uphill along the chosen axis of the mesh's bounds over the samples, fading with distance (93 texels at 2K at intensity 1), blurred by the drips smoothness and scanned by spreading and contrast (spreading 0 and 1 are exactly black and white, as in the reference). The reference's grunge is not reproduced: the Dirt grunge breaks the rust up at the measured strength instead, so the look is close in level but not texel for texel (correlation 0.55 on the test gun, versus about 0.75 for the fitted model with its noise averaged out). The field is built once per layout, occlusion map and setting, with the UV Border Distance gradient's cache and blur now shared in one module. Commands only; no replaceable inputs yet (it reads the baked occlusion and the mesh's bounds whole).
2026-11-24 12:09:41 +00:00
Rebornim c2cad52627 Generators: review fixes for Micro Details and the new kinds
Saved values are brought into range when read (a hand-edited project's infinite smoothness or huge AO radius no longer reaches the blurs and occlusion search), with tests. The UV Border Distance gradient is built once before tiles composite, not by every tile at once; its cache key adds the g-buffer's address and a denser coverage fingerprint, and its Smoothness blur follows each UV tile's own resolution. The micro and border caches keep at most 256 MB besides the newest entry. A generator's own controls are resolved once per plan instead of per texel; project.inspect shows them. Docs say which space the 3D kinds' points live in (the bounds scaled evenly, like the reference's position map) and that an empty micro slot reads a flat height.
2026-11-24 12:09:41 +00:00