Commit Graph
103 Commits
Author SHA1 Message Date
SteamSmithandClaude Sonnet 5.5 e0227222d9 chore(merge): bring fix/undo-merge-ends up to date with main
Kept the per-request end_merge calls and upstream's preview-size preference sync in
command.run.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 12:23:31 -05:00
SteamSmithandClaude Sonnet 5.5 a54c16e42f chore(merge): bring fix/compound-undo-entries up to date with main
Kept both test modules in graph_view.rs and both session fields (undo group and the
hash-keyed decoded-image memo).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 12:16:12 -05:00
Belligerently 2a88e98d24 Validate view settings before applying partial changes 2026-11-05 12:13:52 -05:00
Rafael Mendes cc7c6b0192 Merge pull request #70 from storytold/fix/18-sbs-parameter-functions
Import numeric parameter expressions from SBS XML
2026-11-05 14:12:16 -03:00
SteamSmithandClaude Sonnet 5.5 47b69c0f3a chore(merge): bring fix/bitmap-colour-space up to date with main
Upstream's ResourceBytes and decode limits kept; decode keeps the linear flag, and the
decoded-image memo is now keyed by (content hash, linear) so sRGB and data reads of the
same file don't collide.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 12:10:10 -05:00
Rafael Mendes 99f2932c09 Merge branch 'fix/18-sbs-parameter-functions' of https://github.com/storytold/materialcraft into review/pr-70 2026-11-05 14:09:26 -03:00
Rafael Mendes 977f6c1f24 Merge pull request #69 from storytold/fix/18-function-math
Add missing base-two and Cartesian function primitives
2026-11-05 14:09:24 -03:00
Rafael Mendes cee6a7a38f Merge branch 'fix/18-function-math' of https://github.com/storytold/materialcraft into review/pr-69 2026-11-05 14:07:01 -03:00
SteamSmithandClaude Sonnet 5.5 8fe0e0cc4f chore(merge): bring fix/stale-cook-result up to date with main
Kept upstream's cancellation flag and the epoch check: a stale snapshot is dropped
if cancelled, an edit is pending, or a newer synchronous cook ran.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 11:54:01 -05:00
Rafael Mendes 6b6f8728c2 Bound relief workers and integrate real height previews 2026-11-05 12:25:44 -03:00
Rafael Mendes 96574eaba7 Integrate MCP material export with the current control protocol 2026-11-05 11:35:48 -03:00
Rafael Mendes 4897dab15d Merge branch 'review/pr-43' into review/pr-44 2026-11-05 11:16:47 -03:00
Rafael Mendes a026ddaaf9 Integrate cache keys with SBS and bound graph traversal 2026-11-05 11:02:15 -03:00
Simon Hull e39a227ca1 Merge commit 'e153b8b' into advisor/005-cook-only-what-changed 2026-11-05 07:52:55 -06:00
Simon Hull e153b8b603 Merge remote-tracking branch 'origin/main' into advisor/004-correct-cache-keys 2026-11-05 07:52:44 -06:00
Rafael Mendes a7def58061 Guard export dimensions and verify graph context export 2026-11-05 10:19:26 -03:00
Rafael Mendes 854764bddb Merge remote-tracking branch 'origin/main' into review/pr-25 2026-11-05 10:16:37 -03:00
SteamSmithandClaude Sonnet 5.5 105bfd5a4a fix(engine): record multi-command gestures as one undo entry
Rewiring a dragged link (Disconnect + Connect), dragging a frame (Edit
frame + Move nodes) and Import bitmap (import + add node + set param)
each made 2-3 history entries. Add Session::begin_group/end_group and
Session::group: edits inside a group share one snapshot, an untouched
group records nothing, and a failing group() restores everything. The
UI uses begin/end_group around those gestures.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 07:20:50 -05:00
SteamSmithandClaude Sonnet 5.5 ee903c96ad fix(formats): choose sRGB or linear when reading bitmaps
decode() sRGB-decoded every 8/16-bit color bitmap, so an RGB normal map
(0.5, 0.5, 1) became (0.214, 0.214, 1). decode now takes a linear flag. The
Bitmap node gets a Color space choice (sRGB by default, so existing files cook
the same) and graph input preview images can be bound as linear data maps
(graph.input.bind linear: true, stored in input_images_linear).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 06:58:19 -05:00
SteamSmithandClaude Sonnet 5.5 858dde47a1 fix(cook): drop a stale background cook that a newer sync cook superseded
A background cook of version A could land after session.inspect had
synchronously cooked version B and cleared dirty, overwriting B's results
with no recook. Sessions now count synchronous cooks (cook_epoch) and the
cooker discards a result whose start epoch is out of date.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 06:57:43 -05:00
SteamSmithandClaude Sonnet 5.5 0546dd58c6 fix(engine): end undo merge runs at gesture and request boundaries
merge_key was cleared only by edit/undo/redo/reset_history, so two drags
of one slider, two "New random seed" clicks and two MCP/control
node_param calls collapsed into one undo entry. Add Session::end_merge,
call it on pointer release and around each control/MCP command, and
restore the session when a merged edit fails.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 06:57:14 -05:00
SteamSmithandClaude Sonnet 5.5 a6c7fd46f2 fix(review): keep the open graph open after deleting an earlier one; clamp huge sample coordinates
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-05 06:39:22 -05:00
Rafael Mendes 821c7172b5 Add DirectX normal-map interpretation to the 3D view 2026-11-05 00:04:50 -03:00
Rafael Mendes 91175aafc6 Import numeric SBS parameter expressions 2026-11-04 23:36:54 -03:00
Rafael Mendes dce9f30c5a Add base-two and Cartesian function primitives 2026-11-04 23:25:13 -03:00
PiJellyPin 8bdae1157d Fixed Heightmap 2026-11-05 02:38:04 +01:00
Rafael Mendes 6a249c66ff Merge remote-tracking branch 'origin/main' into feat/alpha-3d-and-wire-editing
# Conflicts:
#	README.md
2026-11-04 20:11:35 -03:00
AndreIsraelAO 3947e3c6f5 Merge main into feat/22-graph-context-export 2026-11-04 17:53:40 -03:00
PiJellyPin 66fdba878f Testing a bunch of stuff 2026-11-04 08:47:10 +01:00
Chris Hassebrook d62ca9ac53 Merge branch 'main' into 49-change-to-sbs-instead-of-mcraft 2026-11-04 01:11:49 -05:00
PiJellyPin 6310230ecd Load sbs files
save, load etc.. for sbs files
2026-11-04 07:03:54 +01:00
Zachary Aflalo c97f92abff Start desktop and browser sessions with an empty graph (#29) 2026-11-04 06:17:40 +01:00
A-Gift-Of-FlameandClaude Sonnet 5.5 ef8ab335c2 feat(automation): material_export MCP tool for portable .mcmat
Sandboxed agents could not hand a material to TextureCraft: the workspace
sandbox refuses `file.*` commands and there was no MCP tool for `.mcmat`.

Add `material_export {path, graph?, size?, values?}` (RPC method
`material.export`). It cooks the graph through the same engine code as
`file.exportMaterial` and writes the `.mcmat` only through
AuthorizedWorkspace (cap-std, `--write-root`): no write root, a malformed
path or an escape is an error, the parent folder must exist, and the file is
capped at what `package_open` may read back. Bridge mode refuses it like the
other path tools. The engine gets a shared `material_request` helper so the
command and the tool parse graph/size/values identically.

Tests: file written and readable, bad requests, denied without a write root
(Denied and read-only workspace), path escapes (`..`, absolute, backslash,
drive, symlink) and the MCP tool end to end. docs/control-protocol.md lists
the method and tool.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-03 23:55:13 +01:00
Simon Hull 76684bc3a8 Cook: format and lint fixes 2026-11-03 14:38:35 -06:00
Simon Hull 2758d1d389 Cook: cancel stale background cooks and lock the cache only around lookups
The cooker sets the running cook's cancel flag when the graph changes again and starts the
new cook at once; eval::cook takes &Mutex<Cache> and locks per lookup/insert.
2026-11-03 14:37:56 -06:00
Simon Hull b991f4fb11 Eval: key nodes only on the graph inputs they read
An exposed-input change re-cooked 21 of 21 nodes in rusty_metal; now 1 (the reader).
Input-change cook (noisy, concurrent load): 1024 ~320 ms -> ~0.1 ms, 2048 ~1500 ms -> ~0.2 ms.
2026-11-03 14:30:34 -06:00
Simon Hull 55f1a1c323 Engine: add cook benchmarks for input changes and parameter edits
Baseline (noisy, concurrent load), input change: 1024 ~320 ms, 2048 ~1500 ms, 21 of 21 nodes re-cooked.
2026-11-03 14:30:34 -06:00
Simon Hull c4d7443218 Eval: key resources on content and graph instances on their whole sub-graph tree
Resources carry a content hash (ResourceBytes); the decoder memo is keyed on it and pruned.
Graphs that use themselves, directly or through other instanced graphs, give an explicit error.
2026-11-03 14:19:15 -06:00
Rafael MendesandClaude Opus 5.5 29dee321d9 feat(graph): select several wires and swap their sources with X
Shift+click adds a wire to the selection and Ctrl+click toggles it. With two
or more wires selected, X swaps where they come from: two wires trade
sources, more reverse them in target-node and input order, so selecting a
Blend node's foreground and background wires and pressing X swaps the two
layers. The wires stay selected, so X again swaps back. Delete and
Backspace remove every selected wire in one undo step, and the wire menu
gains Swap selected links and Delete selected links.

New commands graph.wire.swap and graph.wire.delete take
{wires: [{to, toPort}, ...]}; a swap that would make a cycle is refused and
changes nothing. Engine and UI tests (real clicks on a Blend node) cover
both; docs/wires-and-alpha.md documents the gestures, the ordering rule and
the commands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 14:43:32 -03:00
Rafael MendesandClaude Opus 5.5 8f4dd5b6c1 feat: alpha in the 3D view; select, delete and reroute wires
3D view: the material's alpha (the Opacity output, else the Base color's
alpha channel) now makes the mesh see-through. Rays composite front to back
through up to eight transparent layers and back faces shade toward the
viewer, so the inside of a cut-out mesh and the environment show through.
view.3d takes `transparency` (default on) and `alphaView`; the Display menu
and a bottom-bar button toggle an unlit view of the alpha channel.

Graph editor: click a wire to select it (Delete or Backspace removes it),
drag a wire to pull a reroute Dot out of it, double-click a wire to drop a
Dot there, right-click a wire for Insert reroute dot and Delete link. The
new graph.wire.insertDot command splits a wire with a Dot in one undo step.

Docs: docs/wires-and-alpha.md (gestures, commands, rendering, tests) with
two snapshot screenshots, plus architecture, parity, control protocol,
README and ATTRIBUTION updates.

Clean-room implementation.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 14:32:48 -03:00
AndreIsraelAO e816ad75bb Keep export proportions and expose size in the CLI and MCP
size is now the larger side in pixels and the other side keeps its
proportion; 0 means the graph's size. Adds --size to the CLI export,
size to the MCP outputs_export, and the docs line. The resolution combo
shows the graph's real size.

Refs #22
2026-11-03 07:29:07 -03:00
AndreIsraelAO 3a104b4e72 Add a resolution option to Export outputs
Adds size to file.export and a Resolution selector to the export window.
Only open the export window when the graph opened.

Refs #22
2026-11-03 00:26:12 -03:00
ljkx f8f8d8c2c0 3D view: make the pan limit and speed preferences
Review: no hardcoded limit. The two MAX_TARGET constants are gone.

- Engine: CameraPrefs { pan_limit, pan_speed } with the defaults in one
  place (Default: 5 mesh radii, speed 1), sanitized against NaN and
  negative values. Session::set_camera_prefs stores them and pulls the
  orbit target back inside a lowered limit; view.3d clamps targets to it;
  session.inspect shows it.
- App: Prefs.camera persists with the other preferences (older saved
  preferences load the defaults), apply_prefs pushes it into the session,
  and Edit > Preferences has "3D pan limit" and "3D pan speed" sliders.
  The drag uses the pan speed.
- Renderer: no limit of its own. camera() falls back to the scene center
  for a non-finite target and pan() returns the unbounded offset.
2026-11-03 00:28:44 +01:00
ljkx f786a2d4c3 3D view: pan the camera with Alt+drag or middle-drag
The 3D view could only orbit around the mesh center and zoom, so there was
no way to look at an off-center part of a mesh up close.

- View3d gains `target`, the orbit point's offset from the mesh center in
  mesh radii (world axes, so orbiting after a pan turns around the new
  point). `view.3d {target: [x, y, z]}` sets it, validated before anything
  changes and clamped to 5 radii; view.3d.reset clears it.
- The renderer orbits around the offset target, and `pan` turns a drag
  (in view heights) into a new target so the mesh follows the pointer.
- Alt+drag or middle-drag pans in the 3D view, like the graph. Double-click
  and the Camera presets recenter. The headless render honours the target.
2026-11-02 20:30:01 +01:00
bflatastic 539febca0a Merge remote-tracking branch 'origin/main' into feat/cross-app-materials 2026-11-02 12:49:27 +07:00
bflatasticandClaude Opus 5.5 288e6f22ce Beauty renders and eight new sample materials for the README
- render: an offline hq path (displaced subdivided mesh, ray-traced AO,
  shadowed key light, 3x3 supersampling) on a vignette backdrop; the
  sphere's UVs wrap twice so texels stay square
- CLI/RPC/MCP render: --tiling, --hq and --displacement
- templates: new painted metal plates, lava rock, polished marble and
  wicker weave; reworked brick wall, stone tiles, wood planks and mossy
  ground
- README: new material gallery and refreshed screenshots

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 12:24:11 +07:00
bflatasticandClaude Opus 5.5 53ab0f2d6a Cross-app materials: .mcmat portable materials for TextureCraft
- formats: .mcmat (zip: material.json manifest, maps/<usage>.png, source.mcraft) with
  read/write and caps; color usages 8-bit sRGB, data maps 16-bit linear
- engine: file.exportMaterial {path, size?, values?, inputs?}, file.sendToTextureCraft
  (TextureCraft's library folder), graph.input.bind/unbind; file.open reads .mcmat
- core/eval: Graph::input_images preview images for input nodes (mesh maps from
  TextureCraft); caller images win; grayscale inputs convert to gray
- ui: File > Export material..., File > Send to TextureCraft, Open accepts .mcmat,
  input previews in the graph properties
- docs: control protocol (portable materials), file formats, gaps, parity ≈ 67%,
  roadmap, architecture, AGENTS convention for shared formats

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 12:06:09 +07:00
bflatasticandClaude Opus 5.5 c35c15d6d6 Better stone tiles, rusty metal and stone ground samples
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 05:03:47 +07:00
bflatasticandClaude Opus 5.5 262b2da48d 2D view histogram overlay (view.2d histogram)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 04:55:17 +07:00
bflatasticandClaude Opus 5.5 80f4977023 Dynamic parameters, graph presets and one shared input editor
Parameters can be driven by function graphs evaluated against graph inputs
(graph.node.function); graphs store input presets (graph.preset.*). Graph
inputs and graph-instance parameters share one editor for floats, ints,
bools, enums and colors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 04:51:01 +07:00