An effect's context menu copies, cuts and pastes it, and Ctrl+C,
Ctrl+X and Ctrl+V act on a selected effect (pasting a copied one above
the selected effect, or on top of the selected content or mask).
Painted strokes come along, resampled to the target set; generators
and other one-stack effects go to their stack, and a fill reading an
anchor point needs one below its new layer. effect.copy, effect.cut
and effect.paste share the layer clipboard.
The History panel lists every undone step too (dimmed, next first) and
a click on any step goes back or forward to it, the current one
highlighted. edit.undo and edit.redo take {steps?} for the same jump.
Undoing an effect's add or duplicate took the selected effect away and
left the selection on it, so the row lost its highlight and strokes had
no target. The selection now falls back to the stack the effect was in.
After Cancel or a bake error the app re-queued the same Auto-rebake on the next frame, forever, because a set only counted as up to date after a successful bake. Session::bake_abandoned records the set being baked and the queued ones as seen; cancel_bake and the bake error paths call it. Also drops a useless into_iter() and an unreachable branch in bake.autoRebake.
Each mesh map slot of the Texture Set Settings takes an image resource:
drop one from the Assets panel on the slot, or pick it from the slot's
menu, which also clears the slot. The image is resampled to the size of
the set's other mesh maps (or its bake size), its values read as data,
a normal map in the project's normal format.
textureSet.meshMap.set {ts?, map, image} and
textureSet.meshMap.clear {ts?, map} give agents the same.
The .mtlx tags colour textures with the export's colour space: srgb_texture, lin_rec709, acescg, or lin_ap0_scene for ACES2065-1 (MaterialX 1.39 has no AP0 space; the export warns). A colour map packed into one channel (L) is not converted and now says so. The $colorSpace variable's description lists every value.
Float files (EXR, HDR) hold linear values, so their colour maps are tagged lin_rec709 instead of srgb_texture. The .mtlx goes through formats::write_atomic, and a set whose name sanitises to an earlier set's file name is skipped with a warning instead of overwriting it.
Effect rows in the layer stack can be dragged within their stack (a
drop lands above the row, or below it from its lower half), and their
context menu duplicates an effect just above itself, painted pixels
included. effect.move {effect, index} and effect.duplicate {effect}
give agents the same.
A neighbourhood field covers the bounding box of its tiles, and a
scattered sample spans the whole set, so on an 8K set a blur below the
levels effect evaluated everything. With such a filter below, each
sampled tile now builds its own field.
An odd tile stride: a power of two divides the row length on
power-of-two sets and read the same few columns. A mask is planned on
its own, so a paint layer with nothing painted still shows its mask's
histogram.
The Levels effect's properties now show a histogram of its input, the
mask below it or (on layer content) a channel picked above it, with the
input range marked. effect.histogram {effect, channel?, bins?} gives
agents the same counts. Large sets are sampled (at most 256 tiles), so
the cost stays flat up to 8K.
Alt+click on a channel of a fill's or the brush's Material section turns
that channel on and every other one off (one undo step for a fill).
tool.material and layer.fill.set take solo: true for the same.
Fixes#74.
layer.add.decal and layer.decal.set take up: [x, y, z]. Without it the
decal keeps the view's up, and when that runs along the surface normal
(a top face seen from a level camera) it takes the view direction, so
the far edge is up, instead of an arbitrary perpendicular.
Fixes#64.
Thickness is the mean hit distance divided by the max occluder distance,
so the old shared default of 0.25 of the bounding box diagonal turned most
thin parts of a model nearly black, and long rays reached geometry behind
single-sided parts. 0.1 is the default in Adobe's public baker documentation.
AO and bent normals keep 0.25.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
New texturecraft_texel::ColorSpace (sRGB, Linear Rec.709, ACEScg, ACES2065-1): the matrices are
derived at first use from the published primaries and white points (BT.709, ACES S-2014-004,
SMPTE ST 2065-1) with Bradford adaptation, so nothing is copied from a colour-management
library. ExportOptions::color_space (command and dialog: `colorSpace`) converts the colour maps
on their way out; data maps (normal, height, roughness...) are never converted.
None keeps today's behaviour: sRGB in 8/16-bit files, linear Rec.709 in float files. A linear
space in an integer file is written without the sRGB curve; ACEScg and ACES2065-1 in integer
files warn that values outside 0-1 are clamped (EXR and HDR keep them). `$colorSpace` in a file
name template now also says ACEScg / ACES2065-1. The export dialog gets a Color space combo
(label translated in all ten languages).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
file.importMaterialX {path, material?, name?} reads an open_pbr_surface, standard_surface or
gltf_pbr material and adds one fill layer: image inputs (directly, through a nodegraph output
or normalmap/convert/constant nodes, with fileprefix and the first UDIM tile) become image
resources and sources, literal values become uniform sources (sRGB-tagged colours converted to
linear, colours on scalar channels averaged), the displacement shader becomes height, and the
first image's uvtiling becomes the UV projection scale. Emission follows the specifications'
defaults (off unless emission_luminance / emission is above 0).
Images are read only from the document's folder and below: a document is untrusted. Channels
the texture set lacks, unreadable images and unsupported nodes are reported in `warnings`;
nothing to import is an error. The whole import is one undo step.
Written from the ASWF MaterialX 1.39 and OpenPBR Surface specifications; the reader caps size,
depth and element count and has mutation tests. The inverse of the MaterialX export in #50.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The Assets shelf has a Brushes tab: presets grouped as Basic (hard, soft,
airbrush, square, dots), Wear and grunge (dry brush, chalk, spray, grunge,
splatter, scratches, chips, cracks, drips) and Details (stars, stitches,
rivets, fur), each with a preview of its stroke. A click sets the stroke (alpha,
spacing, flow, hardness, angle, path following, jitters, particles) and keeps
the brush's size, alignment, culling, symmetry and lazy mouse. My brushes saves
the current brush as a .tcbrush file in the brushes folder and lists them.
Commands: brush.preset.list, brush.preset.apply {preset}, brush.preset.save
{path} and brush.preset.load {path} (an image alpha from another project is
dropped). Labels translated into the other nine UI languages.
A map chosen with `bake.autoRebake {map}` (or the new Auto-rebake checkbox in the bake mode's
per-map panel) bakes itself again, alone, whenever what it was baked from changes: the texture
set's bake settings (except which maps are ticked), the low poly, the high polys or the cage.
The apps poll `Session::auto_rebake_due` each frame and bake the due sets in the background;
`bake.autoRebake.run` does the same once, blocking, for agents and scripts.
A set only takes part once it has the map baked at its current output size, so Auto-rebake
keeps a bake current without starting one or leaving a set's maps at two sizes. A manual bake
of the map also marks the set up to date, and a change made while a bake runs triggers another.
The choice isn't saved in the project. The other maps of the set are left as they were.
Strings translated in all nine languages (native-speaker review welcome, as for the rest).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
resource.text draws one or more lines of text, shaped with harfrust (kerning,
ligatures, joined scripts) from the font's outlines (skrifa) and filled by a
non-zero scanline rasterizer, cropped to the ink, as an image resource: white
for the brush alpha, or a color for a decal. text.fonts lists the installed
families and styles, read from each font file's name table only (246 families in
80 ms here); Ubuntu Light and Hack from the UI's built-in fonts are always there
and are the fallback in the browser.
- Properties > Alpha > Text: the text, a font and style, Use as brush alpha and
Place as decal (in the tool's base color).
- Image alphas keep their proportions (their longer side spans the stamp), so a
line of text stays a line; image thumbnails are letterboxed and show alpha.
- harfrust 0.12 and skrifa 0.44 are the versions egui already builds, so the
lockfile gains no packages.
Fixes#40
Adding a filter from the shelf selects it. Every stroke after that was
refused with "the selected effect is not a paint effect" until the user
re-selected the layer, and on a fresh project's empty "Layer 1" the
filter itself showed no change, so filters looked broken.
- With a non-paint effect selected, a stroke paints what lies beneath
it: the nearest paint effect below it in the same stack, else the
paint layer's own pixels (content), or a new mask paint effect
inserted just below it (mask). The new paint goes through the filter.
- A filter on a fill layer's content still cannot be painted, with an
error that says why.
- The shelf tells the user when a filter lands on a paint layer that
has nothing painted yet.
Tests cover each case and fail on the old code.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
file.exportTextures takes `materialX: true` and, next to the textures, writes one
`<mesh>_<set>.mtlx` per texture set: an open_pbr_surface whose inputs read tiledimage nodes,
inside a surfacematerial. It follows the "OpenPBR (separate maps)" preset's inputs (base,
metalness, roughness, anisotropy, coat, fuzz, transmission, subsurface, emission, opacity,
normal through a normalmap node, height as a displacement shader). Colour maps are tagged
srgb_texture; data maps are linear. UDIM sets use the <UDIM> filename token. A set with no
OpenPBR map, or DirectX normals (the normalmap node reads OpenGL), is reported in `warnings`.
Written from the ASWF MaterialX 1.39 and OpenPBR Surface specifications, in pure Rust with no
MaterialX library. Engine tests cover a two-set export, UDIM and the off/warn paths.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Previously, r.request_focus() was called unconditionally on every
frame inside the layer rename editor, which continually wiped out
r.lost_focus() in egui's memory and trapped keyboard focus inside
the text edit. As a result, clicking outside never exited rename mode,
Enter was unhandled, and keyboard shortcuts including Undo (Ctrl+Z)
were permanently suppressed by egui_wants_keyboard_input.
- Request focus via widget ID once when renaming starts instead of every frame
- Submit and close rename mode on Enter or when focus is lost
- Cancel without saving on Escape
- Prevent row double-clicks, row clicks, and drag-and-drop from interfering with active text editing
- Add regression test in session.rs verifying layer.rename and edit.undo
Fixes#39
Colors near a chosen color shift towards a new one, keeping their shading and texture.
27 -> 28 library filters.
- Filter::ReplaceColor {from, to, tolerance, softness}: each color within the tolerance (RGB
distance 0..1) moves by to - from, fading out over the softness (smoothstep); far colors and
scalar channels are untouched; content only (Adjustments)
- effect.add.filter / effect.set take from and to as linear RGB or "#rrggbb"; Properties has a
swatch per color and the two sliders; translations in all eight UI languages
- tests: near, far and halfway colors, scalars; the engine filter library test adds it