Commit Graph
73 Commits
Author SHA1 Message Date
bflatastic 5a64fa20f9 Effect paste: keep the active target, offer it on any row
A paste into a layer of another texture set set the session's target
to the new effect, so a later stroke in the active set could commit to
it. The target now changes only for a paste into the active set. The
layer and effect row menus offered Paste effect only while a layer was
already selected, though a click selects the row first; they now check
the clipboard alone.
2026-11-02 12:36:18 +07:00
BFlat 048424c6ae Merge pull request #128 from storytold/effects/copy-paste
Effects: copy, cut and paste between layers
2026-11-02 12:31:44 +07:00
BFlat b31ff5f6eb Merge pull request #81 from SteamSmith/feat/export-colour-space
feat(export): choose the colour space of exported colour maps
2026-11-02 12:23:13 +07:00
BFlat fddfad71a9 Merge pull request #50 from SteamSmith/feat/materialx-export
feat(export): MaterialX (.mtlx) OpenPBR material per texture set
2026-11-02 12:23:02 +07:00
bflatastic 8c94d053b4 Merge remote-tracking branch 'origin/main' into effects/copy-paste 2026-11-02 12:20:06 +07:00
bflatastic fbceb95242 Effects: Delete and Ctrl+D act on a selected effect
With an effect selected, Delete removed its whole layer and Ctrl+D
duplicated the layer. Both now act on the effect, like the clipboard
shortcuts; effect commands default to the selected effect.
2026-11-02 12:19:21 +07:00
bflatastic 4ca9f424f4 Effects: copy, cut and paste between layers
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.
2026-11-02 12:13:39 +07:00
bflatastic f8f241e804 Merge remote-tracking branch 'origin/main' into history/jump-to-step 2026-11-02 12:00:46 +07:00
BFlat 18b1969712 Merge pull request #122 from storytold/effects/reorder-duplicate
Effects: drag to reorder, duplicate
2026-11-02 12:00:32 +07:00
bflatastic b133186641 History: click a step to return to it
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.
2026-11-02 12:00:09 +07:00
bflatastic d71cdfa3ca Undo: never leave a removed effect selected
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.
2026-11-02 11:35:32 +07:00
bflatastic f6bd07e4d6 Mesh maps: use an image instead of a bake
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.
2026-11-02 11:32:20 +07:00
bflatastic 76b24c4e3d Export colour space: tag MaterialX colour maps with it, warn when a colour map is not converted
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.
2026-11-02 11:24:24 +07:00
bflatastic baf2390691 Merge feat/materialx-export into feat/export-colour-space
# Conflicts:
#	ROADMAP.md
2026-11-02 11:19:11 +07:00
bflatastic bc57653868 Merge remote-tracking branch 'origin/main' into pr50
# Conflicts:
#	ROADMAP.md
2026-11-02 11:15:32 +07:00
bflatastic cc90af09e0 MaterialX export: tag colour maps with their file's colour space, write the .mtlx atomically, warn on clashing set names
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.
2026-11-02 11:15:03 +07:00
bflatastic 0d2f1873cd Effects: drag to reorder, duplicate
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.
2026-11-02 11:13:00 +07:00
BFlat c26847e21c Merge pull request #79 from Rebornim/fix/thickness-default-max-distance
Bake: thickness max occluder distance defaults to 0.1
2026-11-02 11:07:39 +07:00
BFlat b906f41f2e Merge pull request #118 from storytold/filters/histogram-scan-range-shift
Filters: histogram scan, range and shift
2026-11-02 10:38:29 +07:00
BFlat 78e6d7b334 Merge pull request #119 from storytold/materials/ground-and-metals
Materials: platinum, zinc, cobalt, bark, sand, mud, ice, snow and bone
2026-11-02 10:34:38 +07:00
bflatastic 39a2dd9d27 Merge main into filters/histogram-scan-range-shift 2026-11-02 10:27:48 +07:00
bflatastic 4913131cf7 Materials: platinum, zinc, cobalt, bark, sand, mud, ice, snow and bone
Nine procedural materials for the shelf: three metals from measured
reflectance (zinc with crystalline spangles), bark with deep furrows,
fine-grained sand, mud with glossy wet patches, ice with cloudy air
pockets under transmission, and snow and bone with a little subsurface
scattering.
2026-11-02 10:09:29 +07:00
bflatastic d103cc3cfd Leave the material library out of this branch
The new materials belong to their own change.
2026-11-02 10:02:34 +07:00
bflatastic 332cfa4070 Levels histogram: bound the neighbourhood work under a filter
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.
2026-11-02 10:00:24 +07:00
bflatastic a185e5f951 Filters: histogram scan, range and shift
Three adjustment filters for masks and content: Histogram Scan slides a
ramp through the values (contrast narrows it to a step), Histogram Range
squeezes them towards a position, and Histogram Shift offsets them with
wrap-around. Names and parameters are translated into all nine other UI
languages.
2026-11-02 09:52:09 +07:00
bflatastic 83b8a13131 Levels histogram: sample every column, and read masks of empty layers
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.
2026-11-02 09:44:28 +07:00
bflatastic d736ffa9af Levels: a histogram of what the effect reads
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.
2026-11-02 09:23:59 +07:00
bflatastic bd8299c0c7 Merge main into fix/uv-island-fill 2026-11-02 08:27:04 +07:00
bflatastic 98e282b70d Polygon fill: UV island mode follows the UVs across split vertices
UV island fill grew the island through shared vertex indices. Imported
meshes often split vertices along hard edges, or give every face its
own, while the UVs run on; the fill then stopped at single polygons.
Triangles that share an edge in UV space now form the island.

Fixes #51.
2026-11-02 08:10:21 +07:00
bflatastic 3fea0f6c62 Materials: twill for denim and carbon fiber, a pile for velvet
Carbon Fiber, Fabric Cotton, Denim and Velvet were all the same plain
weave in different colours. A new Twill weave pattern (2/2: diagonal
ribs, the weft darker than the warp) now gives Denim its diagonal and
Carbon Fiber its light and dark tows under a clear coat; Velvet is a
soft pile with no weave under its sheen; Fabric Cotton keeps the plain
weave. Twill weave is also a fill pattern, translated into all nine
other UI languages.

Fixes #97.
2026-11-02 07:53:46 +07:00
SteamSmithandClaude Sonnet 5.5 7a59356a33 test: remove the MaterialX export scratch folders when the test ends
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-01 19:26:57 -05:00
SteamSmith fac42eac33 Merge feat/materialx-export into feat/export-colour-space 2026-11-01 19:10:21 -05:00
bflatastic 69df38ffea Texture Set List: show all, hide all, invert, and focus on one set
An eye menu above the list shows, hides or inverts every texture set;
the focus button shows only the active one, and shows them all again
when pressed a second time. textureSet.visibility {mode} does the same
for agents.

Fixes #72.
2026-11-02 07:07:45 +07:00
BFlat fcd1d28e5f Merge pull request #96 from storytold/ui/alt-click-solo-channel
Material channels: Alt+click keeps one channel
2026-11-02 07:07:25 +07:00
BFlat c8368b6a06 Merge pull request #91 from storytold/fix/unnamed-parts-reopen
Projects keep the names of a mesh's unnamed parts on reopen
2026-11-02 06:51:38 +07:00
bflatastic 7e78a2cba6 Material channels: Alt+click keeps one channel
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.
2026-11-02 06:37:04 +07:00
BFlat c0f6ab4f4a Merge pull request #88 from storytold/decal/up-param
Decals: an up parameter, and an upright rule that never degenerates
2026-11-02 06:36:26 +07:00
bflatastic e3bc63d1ca Projects keep the names of a mesh's unnamed parts on reopen
Parts a mesh file leaves unnamed are named after the file. The project
stored the mesh as mesh.<ext> and read it back under that name, so a
reopened quad.gltf named its part "mesh" and geometry masks on "quad"
hid their layer. The project now keeps the imported file's name
(mesh_file) and reads the stored mesh under it, on open and on a
pathless reimport. Older projects read as before.

Fixes #76.
2026-11-02 05:56:33 +07:00
bflatastic 2d1047eb36 Decals: an up parameter, and an upright rule that never degenerates
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.
2026-11-02 05:46:55 +07:00
bflatastic 963008635c display.set: refuse unknown environment names
The built-in environment list moves to core (render re-exports it), so
the engine can name the valid ones in the error.

Fixes #65.
2026-11-02 05:34:40 +07:00
RebornimandClaude Opus 5.5 8a281d7f2c Bake: thickness max occluder distance defaults to 0.1
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>
2026-11-01 22:30:07 +00:00
SteamSmithandClaude Sonnet 5.5 16e70a0145 feat(export): choose the colour space of exported colour maps
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>
2026-11-01 17:28:09 -05:00
bflatastic 355b7e7fd5 Close the brush preset test after the merge 2026-11-02 04:52:35 +07:00
bflatastic e03a9d6c71 Merge remote-tracking branch 'origin/main' into assets/brush-presets
# Conflicts:
#	ROADMAP.md
#	crates/engine/tests/session.rs
#	crates/paint/src/lib.rs
#	crates/ui-egui/src/i18n/ar.rs
#	crates/ui-egui/src/i18n/de.rs
#	crates/ui-egui/src/i18n/es.rs
#	crates/ui-egui/src/i18n/fr.rs
#	crates/ui-egui/src/i18n/it.rs
#	crates/ui-egui/src/i18n/ja.rs
#	crates/ui-egui/src/i18n/ko.rs
#	crates/ui-egui/src/i18n/pt_br.rs
#	crates/ui-egui/src/i18n/zh_hans.rs
2026-11-02 04:48:21 +07:00
bflatastic 1d885c8df1 Brushes: 18 brush presets in the shelf, and your own
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.
2026-11-02 04:28:17 +07:00
bflatastic 7fdd9be0a3 Text: draw text in any installed font as a brush alpha or a decal
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
2026-11-02 04:07:37 +07:00
SteamSmithandClaude Sonnet 5.5 ae211ff590 feat(export): MaterialX (.mtlx) OpenPBR material per texture set
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>
2026-11-01 15:09:02 -05:00
test-bit-sys fb73a5e925 Fix layer rename focus trap and restore Undo
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
2026-11-01 20:02:06 +01:00
BFlat 155fa7343b Merge pull request #28 from storytold/filters/replace-color-filter
Replace Color filter
2026-11-01 17:37:28 +07:00
bflatastic 56a3a655ee Replace Color filter
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
2026-11-01 16:57:50 +07:00