Commit Graph
413 Commits
Author SHA1 Message Date
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
bflatastic d3bc91700f Effect sliders apply what they were dragged or clicked to
The sliders of a selected effect (opacity, generator, levels, HSL,
filters, fill patterns) re-read their value from the document each
frame and applied it when the drag stopped, but on that frame the
pointer no longer drags, so the old value was applied again; a click on
the track was never applied. slider_edit remembers the dragged value
for the release frame and reports clicks and typed values too.

Fixes #46.
2026-11-02 06:37:03 +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
BFlat 7c1d20f084 Merge pull request #83 from storytold/fix/usd-varname-string
USD export: the primvar reader's varname is a string
2026-11-02 06:18:10 +07:00
bflatastic 056a089551 Viewport: show the baked normal map
The viewport's normal texture held only the painted Normal channel, so
a baked normal map changed the export but not the view. Display tiles
now re-orient the painted normal onto the baked one, as export does
(core::blend::rnm, now public).

Fixes #54.
2026-11-02 06:11:11 +07:00
SteamSmithandClaude Sonnet 5.5 4917eda4a8 feat(ui): File > Import MaterialX material... with a file picker
The menu item opens a .mtlx picker and runs file.importMaterialX; the new layer's name is
toasted, the reader's warnings go to the Log, and the Layers panel is focused. The menu label
and the picker's filter name are translated in all ten languages; menu parity is 54 of 54.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-01 17:56:46 -05: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 b5a34048fe USD export: the primvar reader's varname is a string
usdchecker's ARKit profile expects inputs:varname as a string, not a
token. The crate writer gains string values (the STRINGS table).

Fixes #62.
2026-11-02 05:37:47 +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
Agapenordev 4dd4827f48 Merge remote-tracking branch 'origin/main' into fix/paint-with-filter-selected 2026-11-01 23:20:02 +01:00
Agapenordev 8d541b2b98 Merge remote-tracking branch 'origin/main' into fix/import-gpu-oom 2026-11-01 23:10:43 +01:00
Agapenordev 9328250c6a Merge remote-tracking branch 'origin/main' into fix/import-gpu-oom
# Conflicts:
#	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-01 23:10:43 +01:00
test-bit-sys f0242058f2 cli: support builtin:<id> in info command (#63) 2026-11-01 23:06:43 +01:00
Agapenordev ccc88cab3f Merge remote-tracking branch 'origin/main' into fix/paint-with-filter-selected
# Conflicts:
#	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-01 22:58:53 +01:00
SteamSmithandClaude Sonnet 5.5 2385524b00 test: use contains_key in the MaterialX import test
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-01 16:53:56 -05:00
bflatastic 355b7e7fd5 Close the brush preset test after the merge 2026-11-02 04:52:35 +07:00
SteamSmithandClaude Sonnet 5.5 ffd311f516 feat(import): MaterialX (.mtlx) material import as a fill layer
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>
2026-11-01 16:50:10 -05: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
AgapenordevandClaude Opus 5.5 77b685403f Arabic: the empty-layer filter hint
main gained the Arabic table (#47) after this branch started; every key
must be translated there too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 22:46:12 +01:00
Agapenordev 211d199faf Merge remote-tracking branch 'origin/main' into fix/paint-with-filter-selected 2026-11-01 22:35:48 +01:00
AgapenordevandClaude Opus 5.5 af2d42ca0a Arabic: GPU memory and GPU error notices
main gained the Arabic table (#47) after this branch started; every key
must be translated there too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 22:35:40 +01:00
bflatastic f4baf8140a Merge remote-tracking branch 'origin/main' into ui/start-window
# Conflicts:
#	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:29:43 +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
Agapenordev b0cd961e90 Merge remote-tracking branch 'origin/main' into fix/import-gpu-oom 2026-11-01 22:23:11 +01:00
SteamSmithandClaude Sonnet 5.5 5e21cb47c5 i18n: Arabic strings for Auto-rebake
Arabic landed after this branch was cut, and the translation test requires every string in
every language.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-01 16:19:17 -05:00
bflatastic 96b179ccfc Start window: new, open or a recent project at launch
The app opens on the sample project, which left no obvious place to pick a
project. A start window now offers New project, Open, the recent projects and
Continue with the sample project, with Show at startup (also Settings >
Interface > Start window). It opens at launch in the desktop and web apps, but
not when a file is given on the command line or the app runs with --control.

Labels translated into the other nine UI languages; a UI test covers New
project, Continue and the startup setting.
2026-11-02 04:15:55 +07:00
SteamSmithandClaude Sonnet 5.5 aef225f3a6 feat(bake): Auto-rebake keeps one mesh map up to date
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>
2026-11-01 16:14:42 -05:00
AgapenordevandClaude Opus 5.5 3591e02758 Address review: WebGPU verdicts, repaints, lasting memory notice
- Allocation checks never take an unanswered error scope as success:
  native backends block on the verdict; the browser's WebGPU answers
  later, so the full-size texture waits beside the bound placeholder
  (tiles go into it under discarded scopes) and Renderer::prepare
  installs it on success, or keeps the placeholder and reports the set
  on failure. The UI keeps drawing frames while a verdict is pending.
- The GPU side wakes the UI when it records an uncaptured error or an
  allocation failure, so the notice shows even when the app is idle;
  failures are collected after prepare, where late verdicts land.
- Sets the GPU could not hold share one sticky notice (dismissible,
  listing them) instead of a six-second toast each, since they are not
  retried.
- The out-of-memory error is reported as the cause rather than the
  follow-on invalid-texture error.
- The notice no longer uses "▸", which the UI fonts lack (egui panics
  on a missing glyph).

Tests: a late texture stays unbound until accepted; a late rejection
keeps the placeholder and is reported once; a verdict that never comes
counts as a failure.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 22:12:12 +01:00
bflatastic 50ce39fd51 Text: Arabic labels for the text controls 2026-11-02 04:09:36 +07:00
bflatastic 0c9627573e Merge remote-tracking branch 'origin/main' into tools/text-alpha 2026-11-02 04:07:38 +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
BFlat 0788317deb Merge pull request #47 from test-bit-sys/feat/arabic-localization
Add complete Arabic (ar) UI localization
2026-11-02 04:03:28 +07:00
BFlat 1098c6a32a Merge pull request #59 from storytold/ui/empty-mask-slot
Layer rows: the empty mask slot adds a mask
2026-11-02 04:02:58 +07:00
BFlat ee54678120 Merge pull request #53 from storytold/fix/wireframe-polygon-edges
Wireframes show the mesh's polygons, not their triangles
2026-11-02 04:02:54 +07:00
bflatastic 1c110929de Layer rows: the empty mask slot adds a mask
The outlined box beside a layer without a mask did nothing when clicked. It now
highlights with a plus on hover and opens the add-mask menu (white, black, color
selection) for that layer; the layer toolbar's mask menu shares the same items.
2026-11-02 03:34:54 +07:00
SteamSmithandClaude Sonnet 5.5 d1d925a4ad feat(bake): skew correction for high-poly transfer rays
A greyscale skew map over the UV atlas turns the transfer rays that start from the built-in
distance cage from the averaged direction towards the low poly's base normal (the vertex
normal, or each triangle's flat normal). 0 keeps the ray, 1 turns it fully, grey blends. Edge
protection fades the correction out near hard edges (faces more than about 30 degrees apart),
by distance as a fraction of the mesh diagonal and a contrast exponent.

New bake::SkewMap and BakeRequest::skew (a custom cage mesh sets its own rays and ignores it).
Engine: bake.skew.set {value | path, edgeDistance, edgeContrast, base} and bake.skew.clear;
the skew shows in bake.highPoly.list. The map is not saved in the project yet.

Tests: unit tests for sampling, validation, hard edges and the blend; an analytic baker test
(a leaning low poly under a plane: black unchanged, white equals the upright height, grey
between); an engine test through the commands including an image map and refused input.

Ported from SurfaceCraft's baker (MIT OR Apache-2.0) and adapted to this crate's Ctx.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-01 15:29:54 -05:00
bflatastic 7e2b12442b Merge remote-tracking branch 'origin/main' into deps/zip-9 2026-11-02 03:29:23 +07:00
bflatastic eb812f90d4 Arabic: UI font fallback, and the docs
Arabic text needs a font with Arabic glyphs; egui already shapes it and orders
right-to-left runs. The script joins the CJK ones in the lazy fallback fonts:
Noto Sans Arabic from craft-fonts (desktop and web, 0.8 MB), else Segoe UI,
Tahoma or Arial on Windows, SF Arabic or Geeza Pro on macOS, and Noto Sans
Arabic or DejaVu Sans on Linux and FreeBSD. Without any, the picker lists Arabic
by its English name, as for CJK.

ATTRIBUTION, the localization table (panels keep the left-to-right layout),
features, README and roadmap count ten languages.
2026-11-02 03:28:59 +07:00
bflatastic fc510fc892 Merge remote-tracking branch 'origin/main' into feat/arabic-localization 2026-11-02 03:21:53 +07:00
BFlat 841eff5df9 Merge pull request #43 from Agapenordev/fix/control-token-hardening
Control channel: harden the token file and the app's control server
2026-11-02 03:21:28 +07:00
bflatastic bd128ab181 Wireframes show the mesh's polygons, not their triangles
Importers fan-triangulate quads and n-gons, and the 3D and UV wireframes drew
every triangle edge, so a quad mesh showed its triangulation. Meshes now carry a
per-triangle mask of the diagonals the importer added (Mesh::diagonals), and the
wireframe leaves them out (Mesh::wire_edges), unless a UV seam split one from its
twin.

- OBJ reads polygons whole (tobj without triangulation) and fans them itself.
- OBJ, PLY and the polygon sink (FBX, COLLADA, USD, Alembic) share one fan,
  RawMesh::polygon, which records the diagonals.
- The built-in meshes mark their grid quads.
- glTF and STL store triangles only, so they keep every edge.

Fixes #41
2026-11-02 03:20:57 +07:00
AgapenordevandClaude Opus 5.5 93aa3b8eab Paint through a selected filter instead of refusing the stroke
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>
2026-11-01 21:19:58 +01:00
bflatastic 8ffc94e286 zip 9: entry names are fallible; pin 9.0.5
zip 9 decodes entry names on demand, so ZipArchive::file_names and ZipFile::name
return a Result. Package lookups (FBX, usdz) skip names that do not decode, and a
project entry with a bad name is a malformed project. The usdz test reads
data_start as an Option. The lockfile pins 9.0.5 rather than the two-day-old 9.2.0.
2026-11-02 03:12:29 +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
AgapenordevandClaude Opus 5.5 098602ec49 Never crash importing meshes with many materials
Every texture set (one per mesh material) allocated full-size display
textures (base color, emissive, ORM, normal, height, aux, with mips) as
soon as it was created: ~130 MB of GPU memory per set at the default
2048 import size. A 16-material OBJ ran a 4 GB laptop GPU out of memory
and wgpu's default error handler panicked, closing the app.

- Display and aux textures start as 1×1 neutral placeholders and get
  their full size with the first non-neutral tile (or aux image), so an
  import costs no GPU memory until its sets are painted.
- That allocation runs in an error scope: on failure the texture keeps
  its placeholder (no retry per tile), the failure is logged and the UI
  shows a toast naming the texture set and the Viewport ▸ Texture
  resolution setting. Painting and export are unaffected.
- The app installs an uncaptured-error handler that logs and reports
  wgpu errors as toasts instead of panicking.
- The GPU path tracer takes each set's size from its largest texture,
  since any kind (base color included) may now be a placeholder.

Tests: 40 sets of 2048 allocate nothing until painted, one painted kind
allocates alone, the aux texture allocates on its first upload, painted
placeholders render, and the GPU tracer matches the CPU with a default
base color beside varying roughness (fails with the old size logic).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-01 21:05:50 +01:00
bflatastic 94e288a944 Layer rename: focus the field until it has it, and test the editor in the UI
Request focus only while the field has none, so it can lose focus to Enter or a
click elsewhere; this replaces the per-layer temp flag and the second focus
request on double-click. UI tests drive the layer stack offscreen: Enter and a
click elsewhere rename, Escape cancels, and Ctrl+Z undoes the rename afterwards
(all three fail on main).
2026-11-02 02:59:38 +07:00