Commit Graph
256 Commits
Author SHA1 Message Date
chasse20 3496930a87 Cancel active strokes when bake preview starts 2026-11-10 02:29:37 -05:00
chasse20 7e2b3c7e6a Move bake preview setup into the engine 2026-11-10 01:58:43 -05:00
chasse20 832a7f9e89 Fix live bake preview review findings 2026-11-10 01:34:02 -05:00
vangel76andClaude Opus 5.5 254ee16b04 Merge upstream/main into fix/217-generator-offset
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-09 23:26:53 +01:00
MistyMystery 424ab64ce8 Merge upstream main into layers-panel-redesign 2026-11-09 23:54:51 +04:00
MistyMystery 0c1f66d1f5 Live bake preview: update for the bake refactor, share streamed map buffers, narrow the cancel guarantee
Merge upstream main into the branch. The streamed bake now returns the same Arc buffers it handed to the preview, and the document stores those, so a preview never holds a second copy of a map. A cancel leaves the set being baked as it was; sets that finished earlier stay applied.
2026-11-09 19:49:07 +04:00
dotCooCoo 7f52b87b85 UI: use the shared craft-libs crates for dialogs, shortcuts and quit
Bumps craft-ui and craft-window to craft-libs 1b34eba4 and replaces the
app's own dialog, shortcut and quit code with the shared crates.

File dialogs go through craft-dialogs and no longer stop the frame. An
action that needs a path asks for it and continues when the dialog
answers. An answer that acts on the project does nothing, with a toast,
when another project was opened meanwhile. The browser build keeps its
pickers and the startup and crash message boxes stay blocking.

Shortcuts run through craft-keymap's dispatcher, in the main window and
in floating panels. Saved shortcuts keep their stored form, and the
Keyboard shortcuts window and the shortcut labels do not change. A
shortcut on a symbol that needs Shift is recorded without Shift, and
saved shortcuts in the old form still run. A shortcut now runs only on
its exact chord: an extra Shift or Alt no longer runs a plain-key
shortcut.

A window close quits through craft-quit, and the close check runs in
logic, so closing a minimized window with unsaved changes restores it and
asks. A close during a stroke finishes the stroke and asks. The macOS app
menu comes from craft-menu. The unsaved-changes prompt goes on once its
Save dialog has saved the project, and stays open after Cancel or a failed
save.

The window frame guard on Windows and the title bar's buttons stay in the
app, since craft-libs has no code for them.
2026-11-08 22:07:12 -08:00
SteamSmithandClaude Sonnet 5.5 e5f76eb310 fix: never read the remembered mesh path implicitly
A project file could set mesh_path to any host file, and automation allows a
file.reimportMesh without a path, so that command would have read it without
workspace authorization. A command without a path now always uses the
project's own copy again. The desktop UI passes the remembered path itself
(Session::remembered_mesh_path, one rule for "remembered and still there"),
and asks for a file when there is none. Also moves the misplaced doc comment
on read_mesh and documents the touched functions.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 23:24:24 -05:00
SteamSmithandClaude Sonnet 5.5 d8d4140e11 fix: Reimport mesh reads the mesh file again from disk
Reimport mesh re-read the project's own stored copy of the mesh when it had
one, so saving a change to the mesh file and reimporting did nothing. The
project now remembers the path the mesh was imported from (mesh_path, the
spec's "3D mesh path") and Reimport reads that file again. When the file is
gone the menu asks for one, and a command without a path still falls back to
the stored copy. Projects saved before this have no path and ask once.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-08 23:11:37 -05:00
chasse20 c573250601 Merge latest main into baked map import
Preserve both module and translation additions. Register the baked map tests in the consolidated integration suites.
2026-11-08 21:42:24 -05:00
chasse20 12eb4a45da Merge main and resolve color selection UI conflict 2026-11-08 20:25:00 -05:00
chasse20 4ed0d49a1c Move bake preview classification into the engine
Share visualization settings between scene shading and GPU sync, and use then_some for the conditional low-poly pass. Cover per-set distances, selected-set filtering, missing inputs and ownership with engine tests.
2026-11-08 19:13:06 -05:00
chasse20 74c68e005a Merge main and resolve translation conflicts 2026-11-08 18:55:48 -05:00
vangel76andClaude Opus 5.5 df86375a16 Merge upstream/main into fix/clippy-chunks-exact-to-as-chunks
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 12:18:59 +01:00
vangel76andClaude Opus 5.5 0db6a0c0bb Merge upstream/main into fix/179-2d-brush-cursor
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 11:17:40 +01:00
vangel76andClaude Opus 5.5 8a800d32a1 Merge upstream/main into fix/217-generator-offset
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 10:17:27 +01:00
Chris Hassebrook 9aebba686b Fix color selection picking and inspection 2026-11-08 09:13:46 +00:00
Rebornim 433ae07387 Add color selection editor and ID map picking
Properties gets tolerance, a Colors list (swatch, R/G/B, re-pick, remove)
and a Pick color mode: the pointer becomes an eyedropper, both views show
the ID mesh map and the next click adds the ID color under it.
effect.set takes colors; effect.colorSelection.pick samples the texel the
mask evaluates and skips hidden texture sets.
2026-11-08 09:13:46 +00:00
Chris Hassebrook be989fba6f Harden baked map imports and fix TGA decoding 2026-11-08 08:58:07 +00:00
Chris Hassebrook 8e9ffe24ba Merge main and resolve UV stroke conflicts 2026-11-08 08:47:14 +00:00
Chris Hassebrook 13b2e77e76 Fix UV stroke anchors and pressure handling 2026-11-08 03:43:07 -05:00
Chris Hassebrook 8ad3803746 Merge pull request #301 from Rebornim/feat/smart-material-orb-previews
Smart material previews on the preview orb
2026-11-08 03:37:09 -05:00
vangel76andClaude Opus 5.5 07e94e1c86 Merge upstream/main into fix/217-generator-offset
Keep the curvature mode and detail sizes from upstream and route the
finished generator value through Generator::shape so the offset applies
to every generator kind. A non-finite offset now counts as 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 09:18:34 +01:00
Chris Hassebrook e729def8da Merge main and resolve translation conflicts 2026-11-08 07:59:02 +00:00
Chris Hassebrook b177ecc912 Merge pull request #323 from Rebornim/feat/polygon-fill-parity
Polygon fill: box selection, polygon mode, hit-test, visible polygons only and the 2D view
2026-11-08 02:49:29 -05:00
Chris Hassebrook e8145421c3 Fix curvature detail handling and merge main 2026-11-08 07:31:13 +00:00
Chris Hassebrook c87247c6d3 Fix polygon fill drag state and visibility 2026-11-08 02:23:39 -05:00
vangel76andClaude Opus 5.5 6c3e2f9625 Merge upstream/main into fix/217-generator-offset
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-08 08:17:31 +01:00
Chris Hassebrook b966d13da2 Fix filter picker visibility and swap error context 2026-11-08 01:42:22 -05:00
Rebornim 4003e3172d Path tool: live preview while placing points, edit points in the views
- The brush stroke paints while points are placed and dragged (3D and 2D);
  applying is one undo step, Esc removes the unfinished path
- Click the curve to insert a point, select a point and remove it with
  Backspace or the Remove point button; undo steps through point changes
- The selected layer's other paths are drawn (lit under the pointer) and a
  click opens one for editing; 3D lines follow where their paint lands
- A path repaint recomposites only the tiles it changed, not the whole set
- Pen pointer for the tool; new paths start open; Apply/Cancel removed
- Switching texture sets applies a path being placed first

Closes #333
2026-11-08 04:51:39 +00:00
Rebornim b9b5eb4747 Symmetry: movable plane, angle span and on/off; copies paint where their source does
- Symmetry gets an on/off toggle that keeps its settings, an offset of the
  mirror planes and radial axis from the mesh center, and a radial angle
  span; defaults paint exactly as before
- tool.brush takes and reports symmetryOn, symmetryOffset and
  symmetryAngleSpan
- A symmetry copy runs the camera checks (hidden, facing away, angle fade)
  at its source's point, so it paints the mirror of the stroke
- The eye-depth test allows for neighbouring pixels of the same surface
  where it turns away from the camera: strokes reaching the silhouette broke
  into dots there
2026-11-08 01:39:59 +00:00
Rebornim cbe3c86acb Curvature detail: full-strength block borders, neutral raw curvature, stricter sizes
Divide each blurred detail size by the share of the blur window inside its
UV tile block, so texels near a block or map edge keep their strength
instead of fading toward zero. Raw mode reads mid gray when there is no
curvature to sample. The size cache keeps one layout per curvature map.
Mask previews of hidden layers build their sizes once before the tiles run
in parallel. effect.set rejects a sizes array with a non-numeric entry.
2026-11-08 01:38:20 +00:00
vangel76 d8ecfb7d42 Merge upstream/main into fix/clippy-chunks-exact-to-as-chunks 2026-11-08 02:27:35 +01:00
Rebornim 45ab0f42d9 Image drop: clearer decal specs, layer/effect check, menu edge cases
layer.add.decal's spec says the other-set selection is for x/y only and
documents the maskEffect it returns; layer.decal.set's says image keeps
the decal's channel or mask and refuses an effect given with another
layer. The drop menu's channel list scrolls past 60% of the window. A
waiting drop lets go once its menu goes undrawn (the 3D view hidden),
and the click that closes the menu no longer moves a decal being placed.
2026-11-08 01:23:12 +00:00
Rebornim e2a69c4d12 Filter picker: Add filter opens the picker, same-id set edits in place
Add filter still adds a neutral HSL filter, and its slot now opens the
picker straight away; Esc keeps the HSL and one undo removes it.
effect.set naming the filter the effect already is edits its parameters
instead of rebuilding it from defaults. The picker's filter list is
worked out once. The slot cuts long names short between the thumbnail
and the caret, stays highlighted while its picker is open and shows an
outline while it has keyboard focus. More engine tests: a swap on a
mask, an explicit name, refused swaps leave no change and no undo step.
2026-11-08 01:15:26 +00:00
Rebornim a1d010ccb2 Curvature generators: mode and detail sizes
Curvature and edge wear generators read the baked curvature map one
texel at a time, so they only marked the sharpest edges. They now take a
mode (edges, cavities, both, raw) and seven detail size weights: the map
itself and the map blurred at 1 to 32 texels at 2K, padded past the UV
islands and built once per map and layout. Each size's edges and
cavities combine like a screen blend.

New curvature and edge wear generators use detail sizes. Generators saved
without them, and smart masks, read the map exactly as before.
2026-11-08 00:10:40 +00:00
Rebornim c827d1b910 Drop a shelf image on the texture set under the cursor, as a channel or a mask
An image dragged over the 3D view highlights the texture set under the
cursor, as materials do. A drop opens a menu at the drop point: Mask, then
that set's channels. A pick selects the set and places the decal there
with the image in the picked channel, or as the gray mask of a new fill
layer. A click elsewhere places nothing; the background opens no menu.

layer.add.decal takes channel (a channel id, default baseColor, or
"mask") and adds the decal to the set under the point, selecting it, as
one undo step. layer.decal.set takes effect to edit a mask decal, so the
view's frame and handles work on it too, and a new image stays in the
channel the decal was placed in. One-value channels and masks read an
image's gray instead of its red.
2026-11-08 00:10:09 +00:00
Rebornim ca19e714a0 Filter picker: swap a filter's type from its Properties slot
effect.set takes filter: <id> to swap a filter effect's type in place,
keeping its place, blending, opacity and visibility (one undo step).
A reusable resource_picker shows grouped, searchable shelf tiles at a
slot; the filter slot uses it, and Add filter adds a neutral filter.
2026-11-08 00:09:49 +00:00
vangel76andClaude Sonnet 5.5 9c570137f7 Keep the pointer over the 2D view header and size the brush outline by pen pressure
The brush cursor in the 2D view hid the system pointer and drew the outline
over the view header pickers. Its radius also ignored pen pressure, while
painting shrinks the stamp towards min_size. Both now follow the painted
footprint (BrushSettings::uv_stamp_radius, shared with continue_stroke_uv),
with regression tests for header hover and partial pressure.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 15:37:56 +01:00
Rebornim bac53688c1 Bake mode: draw the high poly, the cage and where the bake's rays miss
The 3D view in bake mode gets a Baking Visualization panel (high poly, cage,
UV seams, low poly, selected texture set only). The cage is built from the
bake's own ray starts (a RayFrame now shared by the bake and the view), so it
grows and shrinks with the distance sliders exactly as the rays do, and
high-poly vertices the transfer rays cannot reach are drawn red.

Refs #330
2026-11-07 13:26:38 +00:00
Rebornim 3836730030 X inverts the mask paint value while painting a mask
New command tool.swapMaskValue (mask value becomes 1 - value), default
shortcut X, enabled only while the selected layer's mask or one of its
mask effects is the paint target. Ctrl+X stays cut. Closes #332.
2026-11-07 12:26:07 +00:00
Rebornim 6eed52435d Match UV tiles per file, skip empty imports, review cleanups
- Each tiled file is keyed by its own tile number and its image passed to
  use_images, so tiles named differently or renamed on import still match
- Files of a tiled set without one of its tiles, and maps missing a tile, go
  to unmatched instead of failing the import
- Nothing to import leaves no undo step
- The map is read from the file name after the set name
- Toast counts maps; a failed import keeps the file list
- Cap the bytes one import reads; whole-method cleanup of set, use_images,
  tile_images and new_project
2026-11-07 09:14:41 +00:00
Rebornim cfe837b86c Import baked maps when creating a project
New project > Advanced settings gets the project's normal map format and
Import baked maps: Add lists image files, and Create imports them with the
new textureSet.meshMap.import command, which sets each file as the mesh map
of the texture set and slot its name names (Body_ambient_occlusion.png,
Body_normal.1001.png) in one undo step and reports the files it left out.
2026-11-07 09:14:40 +00:00
Rebornim 695a3eed91 Shift+click paints straight lines in the 2D view
The 2D view keeps the end of the last finished stroke in texture coordinates,
with its texture set, so a line drawn after zooming or panning joins the same
texels, and previews the line while Shift is held, as the 3D view does. A
cancelled stroke (Escape) leaves the line start where it was.

Session::continue_stroke_uv stamps a long segment in batches of 4096 up to
1 << 17 stamps instead of stopping at 4096, keeps its carry within one step,
and seeds stamps from the stroke's running count (UvStrokeState) so noise
alphas don't repeat every pointer sample. The line preview is clipped to the
view, keeping its dash phase.

Refs #306
2026-11-07 08:22:27 +00:00
Rebornim 49bd4a1273 Polygon fill: review fixes
- A box drag always finishes: on release (even after a failed move), before
  any edit, undo, redo or tool change, and when a scripted box fails or
  starts while another drag is open. A camera move mid-drag (wheel zoom)
  keeps the drag and selects again from the new camera.
- A drag projects the mesh once, skips repaints whose box hasn't moved,
  and builds each grouping once; triangle edges are computed once.
- 2D clicks read the triangle from the set's UV G-buffer at the clicked
  texel, so collapsed UV faces can't take the click.
- Brush strokes no longer record the nearest-triangle buffer; only polygon
  fill asks for it (EyeDepth::render_with_triangles). Screen projection is
  shared through paint::screen_point.
- A box touching the view's edge or zero-size on whole pixels selects
  exactly the pixels it covers.
- Click fills never merge into a box drag's undo step; FillMode moves to
  its own file; partial box parameters get their own error.
2026-11-07 07:52:40 +00:00
Rebornim 3b302b88dc Polygon fill: box selection, polygon mode, hit-test, visible polygons only and the 2D view
A drag in the 3D or 2D view draws a rectangle and fills what it selects
live; releasing it records one undo step. A click still fills one target,
now also in the 2D view. Fill modes gain Polygon (the source quad or n-gon,
from the importer's diagonals), and Mesh fills connected geometry. The
hit-test picks polygons the rectangle touches or whose center it holds;
visible polygons only uses a nearest-triangle buffer next to the eye-depth
raster, leaving hidden texture sets out.

Polygon fill's properties show its own settings and, by selection, the
material, the mask gray, or why it can't fill. Wireframes show while the
tool is active without changing the saved toggles.

Commands: tool.fillMode takes polygon, tool.fillSelection sets hitTest and
visibleOnly, and tool.click takes a screen box, a UV point or a UV box.
2026-11-07 07:00:12 +00:00
RebornimandClaude Opus 5.5 19f75c3a00 Smart material previews on the preview orb
Smart material shelf tiles and hover previews render the real material,
applied with materials::apply to the baked preview orb and composited by
the compositor, lit in a dark studio of soft boxes. MaskPreview becomes
OrbPreview (masks and materials share one bake and one worker). Tiles
show a loading icon until their preview arrives; the web takes one
worker request per frame. preview::material keeps plain materials only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 08:16:05 +00:00
chasse20 03a9870db2 Fix shelf hover previews and clean up comments 2026-11-06 01:12:55 -05:00
chasse20 a13e96d8b5 Merge authoritative bake settings and UV tile controls 2026-11-06 00:17:28 -05:00
chasse20 b315cde16a Merge main into shelf hover previews 2026-11-05 23:57:27 -05:00