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.
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.
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>
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>
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.
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.
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>
- 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
- 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
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.
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.
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.
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.
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.
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.
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>
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
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.
- 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
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.
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
- 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.
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.
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>