Repository navigation
feat: the editors and exchange, model export and new readers (0.12.0) - #7
Merged
Merged
Conversation
stage_from_export writes layer metadata (defaultPrim, upAxis Y, metersPerUnit 1, doc, customLayerData with generator and copyright), one root Xform of kind component, an Xform per group and a Mesh per part with xformOp:transform in USD's row-vector layout, points, triangle faces, vertex normals, st and further UV sets, displayColor and displayOpacity, extent, subdivisionScheme none and doubleSided; prim names become unique identifiers. Materials go under one Materials scope with a UsdPreviewSurface network (UsdUVTexture, UsdPrimvarReader_float2, UsdTransform2d, factors as texture scale and bias) bound through MaterialBindingAPI, and outside AR an OpenPBR MaterialX shader and the FormShot JSON in customData. Cameras use USD's tenths-of-a-unit lens convention, lights are UsdLux sphere, distant, rect and disk lights. AR mode centres the product on the ground, instances shared meshes from class prototypes, drops lights and the MaterialX shader, and colours dense meshes without UVs by displayColor. cargo check -p fsh-io passes; verification follows.
Every row of the settings table now carries a help text shown under its label, and the table gains the preferences that lived elsewhere, each on its existing storage key: the viewport engine, the largest in-window frame and the WebGPU start-up limit (Viewport page, beside quality, adaptive sampling and the viewport denoiser), the mouse navigation preset (Navigation page, applied through view.navigation.*), the import sheet's defaults and the default CAD quality (Import page), and the theme and accent as live rows. The window gets a search field in its header that filters rows across all pages by label, help, group and page name (registered pages by title, keywords and text), hides empty groups, pages and tabs through hidden flags, highlights matches with the CSS highlight registry, and answers Mod+F and Escape. Each row that differs from its default shows a reset button in a column every row reserves, and each page head has Reset Page. Export Preferences and Import Preferences write and read one versioned JSON file (download and file input in a browser, the native panels and the prefs bus on the desktop); import validates every key and lists what it skipped. settings.list returns the table with current values; settings.get also takes a storage key. Verified: tsc and vite build pass. Browser runs follow in the next commit.
The node editor window gains a left browser (collapsible to a fixed rail) with a search over node kinds, the operations inside them (math operations, gradient and wave shapes, voronoi features and metrics) and setups, a Setups section with Save Selection as Setup, and the engine's live preview above it. The add menu (Tab, Shift+A, right click) searches the same entries. A wire dropped on empty canvas opens the add menu filtered to nodes that can connect and links the new node; a node dragged from the browser, or a free node moved, onto a wire is inserted when the types allow. Graphs with no arranged positions are laid out in the window and Tidy (Shift+T) arranges the graph as one undo step. The graph's pick menu takes the shell menu's floor under the menu bar, the cap set before measuring and the more-below hint. Verified with npx tsc --noEmit and npx vite build; the window has not been driven in a browser yet in this commit.
export.spin queues one normal render job per view of a ring of cameras generated about the active camera's target (its distance and elevation, turning about world up; columns per row, default 36, and rows over an elevation range). Each job renders a copy of the document with its own camera, so the open document and its history never change. A thread of the export waits for every frame, then writes frames/<row>_<column> through fsh_io::write, a sprite sheet scaled to fit 16384 px, manifest json and js, and the page (index.html, spin.js, spin.css embedded with include_str!) into a hidden staging folder renamed into place at the end. export.spin_status reports progress; export.spin_cancel stops the frames and removes the staging folder. Verified so far: cargo clippy -p fsh-commands --all-targets -D warnings is clean. Not yet run end to end.
UV edits change a mesh every part shares and may split vertices, so they need the whole mesh replaced under its own key: mesh.add followed by scene.set_part_mesh would give each edit a new key, break the session's seam memory and could not merge a drag into one undo step. mesh.replace lives in its own file (mesh_replace.rs) and is registered with four lines: a table entry, the apply and merge arms in command.rs, and its schema in catalogue.rs. With merge true, replaces of the same mesh merge until a barrier, as the other continuous edits do; the stored command is the whole mesh, so redo and journal replay repeat it exactly. Verified with cargo check -p fsh-scene.
patchList calls update only for rows it already has, so new group headings and key caps were created empty: both create callbacks now paint the node they make. The Shortcuts window shrinks its top resize corners to 10 px, because the shared window's 18 px corner covered the middle of the close button. Verified in headless Chrome against the service on port 8315 with the CPU throttled 4x: 27 checks of the scratch script passed (window from the Edit and Help menus, search, find by keys, Swap, Replace and Cancel, menu and palette key caps, the new key running its command, export and import, presets, resets, the Preferences page).
Section in the window HASHOUT_LOG with the already-covered menus, the changes and the measured numbers.
View > Presentation (F5) hides the window chrome through one attribute on the app root (data-fsh-present, CSS in present.css), fills the window with the viewport on black, keeps the render's aspect by sizing the frame from container units, and switches to the rendered shading until it is left (Esc). A slim strip over the bottom of the picture steps the shots (arrows, Page Up and Page Down), switches configurator choices, plays the timeline when the document moves, toggles full screen (F11) and leaves; it fades with the cursor after two seconds without pointer movement. shot.apply and config.select are undoable document edits, so the presentation opens a history group on entry and abandons it on exit, then puts back the selection and the shown time. New strings are in the present namespace. Ran: npx tsc --noEmit (clean) and npx vite build (built). Not yet run in a browser; that follows in the next commit.
The Find by keys, Export and Import labels were written into the first
span of each button, which is the icon, so the text replaced the icon
and overflowed a 14 px box. The labels now have their own span. The
window's status line says "changed for {n}" so one command reads well.
Verified in headless Chrome at 4x CPU throttling with macOS emulated
(navigator.platform MacIntel): Mod shows as the Command symbol in the
editor and the menus, Command+L records as Mod+L and runs the command,
Control+L is refused while recording and does not run it; 6 of 6
checks passed and no layout shift without input after load.
ext/uv.rs answers ten commands on one mesh (by mesh key or part node) and one UV set: uv.layout (read-only: uvs, indices, chart per triangle, edge kind per corner, welded vertices, seam pairs, stretch per triangle, stats with texel density, set count and the parts sharing the mesh, as JSON numbers or base64), uv.unwrap, uv.relax, uv.pack, uv.symmetrize, uv.transform (merge true for drags), uv.add_set, uv.remove_set, uv.copy_set and uv.export_layout (SVG text or PNG through fsh_io's writer). Every write rebuilds the mesh from fsh-uv's vertex map and runs one mesh.replace, so it is one undo step, journalled, and the render and viewport refresh; when set 0 changes on a mesh with tangents, tangents are accumulated again from the new UVs without splitting vertices. Verified with cargo check -p fsh-commands; dispatch runs follow.
57 new English strings of the Shortcuts window, the conflict prompt, the presets and the import report; 13 strings the editor uses already exist in other tables and are reused. The Reset All tooltip now uses the same sentence as its confirmation instead of a near copy. The per-language tables are left to the translators. Verified: npx tsc --noEmit passes and ./formshot i18n check exits 0.
docs/SHORTCUTS.md describes key combinations and exact matching, the Shortcuts window, the conflict prompt, the three key maps, storage and the key map file with its import rules. The frontend HASHOUT log gains the module in its map and contents and a section on the window, the shared editor, the key map model, the exact chord check in the shell's listener, the replaced Preferences block (quoted) and what was run. Documentation only; nothing was rebuilt for this commit.
Island, device, Home context and the four popover classes (lighting, shots, material, timeline) now take a floor at the in-window bar's bottom edge, an inline max-height of min(75 percent, window minus top minus 4) set before measuring, an inner scrolling list with the fade, and the pill. Shared helper ui/menu-fit.ts and menu-fit.css. Home/End added to the three keyboard handlers that lacked them. Built with tsc --noEmit only; headless verification still to run.
patchList only updates nodes that already exist, so shot and choice chips made on entry stayed empty until the next paint; they are now painted when made. Labels that set their own visibility (the shading name, the engine state) showed through the hidden chrome, so hidden regions also take opacity 0 and no pointer events, and the raster and overlay canvases are hidden so only the traced picture shows (no selection outline or guides). Leaving now hides the strip at once (closing), reads the history depth, selection and shown time in one parallel step, then abandons the group while the selection and time are put back. Ran in headless Chrome against the service on 8317 with the CPU throttled 4x: a document with three shots, a two-option configurator and a turntable; entering went from the normal layout to the final one in one frame (layout shift 0.2, the viewport itself), shots stepped with Right, Page Down and Left, Blue and No lid applied, the strip faded after 2 s with the cursor hidden and came back on movement, play started the turntable, F11 entered and left full screen; Esc restored camera, selection, history depth 17 and redo 1 with the same labels, the dirty flag, the configuration, the shown time and Solid shading.
docs/PRESENTATION.md describes entering and leaving, the hidden chrome and the letterboxed rendered picture, the strip and its keys, full screen in the browser and the desktop app, and how the presentation leaves the document unchanged (a history group abandoned on leaving, with the selection and shown time put back), with its known limits and window commands. frontend/HASHOUT_LOG.md gains a Presentation mode section (the chrome and keys, the strip, the history group with the throttled headless run and its numbers, the present namespace) and the module in its map and contents. Ran: python3 setup/i18n.py check (exit 0). The headless run recorded in the log is the one from the previous commit.
The reserved workspaces module now registers a Workspace menu between Scene and Render with five built-in layouts (Default, Dress, Lighting, Shots, Viewport Only) and the person's own workspaces (save, update, rename, delete), kept in localStorage formshot.workspaces and mirrored to the service's settings ui map. Applying one sets widths, inspector page, library, inspector, timeline and dock through ShellControls and the existing commands in one task. Full View (Tab) hides every panel and restores exactly what it hid. Inspector sections can be dragged by their headers with pointer events and transforms, then moved once; the order is kept per page in formshot.sectionOrder. The library and inspector toggles get their default keys M and Space; a key gate keeps Space, Tab and M out of text fields, dialogs, the dock and controls. Verified so far: npx tsc --noEmit and npx vite build pass. Not yet run in a browser.
Section ordering now works on every group of top-level sections inside an inspector page, not only on the page itself, so the Image page's collapsible sections (inside their own wrapper) can be dragged too; each group is stored under "page" or "page/wrapper". A dragged section now swaps when its top edge passes the midpoint of a section above it, or its bottom edge one below it, so dropping onto a header lands there. Applying a workspace no longer leaves focus in the timeline when it opened it and the element focused before (a closed menu row) cannot take focus back. Verified in headless Chrome against the service on port 8316 under a 4x CPU throttle: Lighting and Image page drags (one DOM move, zero layout-shift entries), reload keeps the order, Reset Section Order restores it; tsc and vite build pass.
Adds docs/WORKSPACES.md (built-ins, own workspaces, Full View, the Space, M and Tab rules, section order and where each is stored) and a Workspaces section in the frontend HASHOUT log with the decisions, the measure.tool key conflict and what ran in headless Chrome under a 4x CPU throttle, plus the module and namespace in its map and contents. Documentation only; nothing was run for this commit.
bake_export takes the document an export scene was built from and bakes every material whose bake marker is set: the material is compiled to its program, the nodes wearing it (own slot or variant) are grouped by mesh, part tint and, when the program reads world-space values, placement, and each group is baked on the mesh's own uv set 0 or on an atlas written as a new mesh shared by the groups on that mesh, keeping the other uv sets, colours and tangents. Later groups get copies of the material. Pictures become 8-bit PNGs (base colour and emission sRGB, the rest linear), uniform ones become constants, emission is normalised into emissive and its strength, and tangents consistent with the baked normal are written where the mesh has none. When the exported mesh no longer matches the document's the bake reads the exported geometry and says so. fsh-bake now depends on fsh-io for the export scene and the PNG writer, which adds one line to Cargo.lock. cargo clippy -p fsh-bake --all-targets -D warnings passes; not run yet.
build_scene walks the document in order and gives every model writer the same ExportScene: nodes with local and world matrices (column major), shared meshes kept shared, parts with their material, lights in physical units (point and spot in candela, sun in lux, area lights in nits, with the same unit conversions the snapshot uses), the saved cameras as camera nodes with the active one marked, material variants flattened to one list (set and variant names when there are several sets), node metadata and visibility, the generator and the document author as copyright. Cutaways are left out and hidden nodes are left out unless asked for, both reported in warnings. exchange/maps.rs maps a material's OpenPBR parameters to the metallic roughness fields and every extension field and keeps the full OpenPBR set beside them. Texture slots are carried as maps with their UV set, wrap, filter and transform (converted to glTF's texture transform); a map is passed through untouched when the picture is PNG or JPEG and the slot reads it exactly as glTF does, otherwise its values are evaluated the way the material program reads them (colour space, channel, invert, range, normal green flip) and packed into a new PNG, sRGB for colour maps and linear for the rest. Graphs, labels, projections other than UV and slots a writer cannot express mark the material with its BakeReason; bake::apply runs when baking is asked for. With native set each material carries its FormShot JSON and the pictures its texture keys name. bake.rs is not touched. Verified with cargo check -p fsh-commands (clean).
The exchange group answers export.formats (read only: each format, its
extensions, what it carries, its side files and options) and
export.model {path, format, selection_only, hidden, variants, bake,
bake_size, native, ascii}. The format follows the extension unless
given; glb goes to write_glb_scene, obj, stl and ply to their writers,
usda, usdc and usd to write_usd and usdz to write_usdz, whose errors
pass through unchanged. Side files (the MTL and pictures of an OBJ, the
textures a USD layer names) are written beside the main file, refused
when a writer names a path outside its folder, and every file goes
through the atomic write. GLB exports add warnings for area lights
written as spots and for material values glTF cannot hold.
file.export_model keeps its arguments and now runs export.model with
format glb, so the CLI's convert to .glb takes the new writer.
raw_scene stays in export.rs because lib.rs re-exports it.
Verified with cargo check -p fsh-commands (clean).
The glTF reader now reads what the GLB writer writes: KHR_lights_punctual lights on their nodes, KHR_materials_variants names and the per primitive mappings, KHR_node_visibility, node metadata under extras.formshot, the tint of full transmission without a volume, and a material's FormShot JSON under extras.formshot with the pictures its texture keys name. Lights, node values, variants and the native JSON sit in side tables on RawScene and RawMaterialExtra so every literal of the older types keeps compiling; RawScene::drop_native forgets the JSON so an import maps the file's own values. to_import_command turns lights into light nodes (point and spot in candela, directional as a sun in lux), applies visibility and metadata, imports the materials variants name and records each part's material per variant under the material.variants metadata key, and replaces a material by its FormShot JSON (texture keys remapped to the imported textures, references restored) when the JSON is present and valid. Verified with cargo check -p fsh-commands (clean).
fsh_io::mapset scans a folder, a ZIP archive or the folder of one map, groups images by the file name prefix before their last role word (resolution, format and variant tokens after it ignored), picks one map per role (decodable formats and OpenGL normals first), reads a real-world size from a JSON file (millimetre dimensions or a size in metres) or a name token, else 1 m, and turns each set into a material draft: triplanar in object space at the set's size or uv set 0, glossiness inverted, DirectX normals flipped, packed ARM maps split by channel. Verified with cargo check -p fsh-io only.
The dock adapter's chord check (isDockChord and passKey) matched a chord holding the modifier that is not Mod on this platform, so Control+J on a Mac toggled the dock although the shell's own listener now refuses such chords. comboId applies the same exact-chord rule as the shell's listener. Found by the shortcuts editor's builder. Checked with tsc --noEmit; not run in a browser.
Workspaces gives the library toggle the key M, as the study's layout keys do, but the Measure tool also claimed M and, registering later, won it. Measure now defaults to Shift+M and its button title says so. Checked with tsc --noEmit; the workspaces builder checked the same binding through a shortcut override in headless Chrome.
Presentation mode's full screen toggle uses the window's setFullscreen on the desktop, which needs core:window:allow-set-fullscreen in the engine page capability; until now the toggle fell back to the page's own full screen. Checked by parsing the file as JSON; the desktop app was not built.
The desktop window picks a path with the native open and save panels but cannot touch the file itself, so the prefs bus gains prefs.write_file and prefs.read_file. Both take only absolute .json paths, refuse files over 1 MB, write through a .part file and answer read errors with a clear message. They live on the window-only bus and never reach MCP. Verified: the module imports in the service's venv; the commands were exercised later through the window's export and import.
The top corners of the editor window's resize handles are now as thin as the top edge and the side edges start under the header, so the close button (and the other header buttons) of the graph, UV and shortcuts editors take a click in their middle instead of starting a resize; every edge and corner still resizes. The node browser captures the pointer only once a drag starts, so a double-click adds the item instead of being retargeted to the list. The live preview box keeps its square but shrinks with short windows so the browser list stays usable. Verified in headless Chrome against the service on 8311 with this tree's engine: elementFromPoint at the close button's centre is the close button at 1280x800, 1871x1080 and 1000x480; double-clicking a setup adds it as one undo step; at 1000x480 the preview is 126 px and the list 97 px.
The Setups header of the node browser is keyed by whether it carries the save button, so clearing a search brings the button back instead of reusing the header row made without it. Verified in headless Chrome: after searching "noise" and clearing the field, Select All, Save Selection as Setup and Enter list the new setup (no history step), and its remove button deletes it.
Fixes found in headless Chrome runs. A setting change now queues the window's own sync, so a select row shows its reset button at once instead of on the next unrelated refresh. The tab rail holds its height while a search is active, so the fold button no longer moves as tabs hide, and the match count has a fixed width. The import report fills skipped rows when they are created (patchList calls update only for existing nodes). After a row or page reset the focus moves to the row's control or the page head, since the hidden reset button would otherwise drop it to the body and Escape would no longer close the window. Verified against the service on port 8314 under 4x CPU throttling: all checks of the run passed (search across pages, Mod+F, Escape, reset, export, Reset Page, import with three skipped keys, round trip, viewport engine after reload). Layout shift: 0.0000 without input during search, reset, export and import; filtered results moving after typing sum to 3.48 (all with recent input).
Adds the exchange namespace (175 strings) and updates the import toast key that now names USD, USDZ, 3DM and IFC. Kept in English on purpose: product and format names, DirectX, Bake, Sheen, Specular, Maps and Path Tracing (terms the existing German tables use).
Adds the exchange namespace (175 strings) and updates the import toast key that now names USD, USDZ, 3DM and IFC. Kept in English on purpose: product and format names, DirectX, bake, sheen, sprite sheet, path tracing.
Adds the exchange namespace (175 strings) and updates the import toast key that now names USD, USDZ, 3DM and IFC. Kept in English on purpose: product and format names, DirectX, bake, sheen, metalness, maps, path tracing.
Adds the exchange namespace (175 strings) and updates the import toast key that now lists USD, USDZ, 3DM and IFC. Kept in English on purpose: product and format names, DirectX, and the technical map roles sheen and specular.
Adds the exchange namespace (175 strings) and updates the import toast key that now lists USD, USDZ, 3DM and IFC. GLB, OBJ, STL, PLY, USDA, USDC, USDZ, MaterialX, ZIP, PBR, DirectX, JPEG, PNG and FormShot are kept as written; no other string was left in English on purpose except where noted in review.
Adds the exchange namespace (175 strings) and updates the import toast key that now lists USD, USDZ, 3DM and IFC. GLB, OBJ, STL, PLY, USDA, USDC, USDZ, MaterialX, ZIP, PBR, DirectX, JPEG, PNG and FormShot are kept as written; no other string was left in English on purpose except where noted in review.
Adds the exchange namespace (175 strings) and updates the import toast key that now lists USD, USDZ, 3DM and IFC. GLB, OBJ, STL, PLY, USDA, USDC, USDZ, MaterialX, ZIP, PBR, DirectX, JPEG, PNG and FormShot are kept as written; no other string was left in English on purpose except where noted in review.
Adds the exchange namespace (175 strings) and updates the import toast key that now lists USD, USDZ, 3DM and IFC. GLB, OBJ, STL, PLY, USDA, USDC, USDZ, MaterialX, ZIP, PBR, DirectX, JPEG, PNG and FormShot are kept as written; no other string was left in English on purpose except where noted in review.
Adds the exchange namespace (175 strings) and updates the import toast key that now lists USD, USDZ, 3DM and IFC. GLB, OBJ, STL, PLY, USDA, USDC, USDZ, MaterialX, ZIP, PBR, DirectX, JPEG, PNG and FormShot are kept as written; no other string was left in English on purpose except where noted in review.
Adds the exchange namespace (175 strings) and updates the import toast key that now lists USD, USDZ, 3DM and IFC. GLB, OBJ, STL, PLY, USDA, USDC, USDZ, MaterialX, ZIP, PBR, DirectX, JPEG, PNG and FormShot are kept as written; no other string was left in English on purpose except where noted in review.
Adds the exchange namespace (175 strings) and updates the import toast key that now lists USD, USDZ, 3DM and IFC. GLB, OBJ, STL, PLY, USDA, USDC, USDZ, MaterialX, ZIP, PBR, DirectX, JPEG, PNG and FormShot are kept as written; no other string was left in English on purpose except where noted in review.
Adds the exchange namespace (175 strings) and updates the import toast key that now lists USD, USDZ, 3DM and IFC. GLB, OBJ, STL, PLY, USDA, USDC, USDZ, MaterialX, ZIP, PBR, DirectX, JPEG, PNG and FormShot are kept as written; no other string was left in English on purpose except where noted in review.
Adds the exchange namespace (175 strings) and updates the import toast key that now lists USD, USDZ, 3DM and IFC. Kept in English on purpose: product and format names, DirectX and the map name examples basecolor, roughness, normal.
Adds the exchange namespace (175 strings) and updates the import toast key that now lists USD, USDZ, 3DM and IFC. Kept in English on purpose: product and format names, DirectX, the technical map roles sheen and specular, and path tracer.
Adds the exchange namespace (175 strings) and updates the import toast key that now lists USD, USDZ, 3DM and IFC. Kept in English on purpose: product and format names, DirectX, the technical map roles sheen and specular, sprite sheet and path-traced.
Adds the exchange namespace (175 strings) and updates the import toast key that now lists USD, USDZ, 3DM and IFC. Kept in English on purpose: product and format names, DirectX, the technical map roles sheen and specular, sprite sheet and path-traced.
Adds the exchange namespace (175 strings) and updates the import toast key that now lists USD, USDZ, 3DM and IFC. GLB, OBJ, STL, PLY, USDA, USDC, USDZ, MaterialX, ZIP, PBR, DirectX, JPEG, PNG and FormShot are kept as written; no other string was left in English on purpose except where noted in review.
A fully transmissive material with no volume and a white transmission colour (clear glass, the spheres and sample templates) kept its own base colour (0.8 grey) in the export scene, because the glass branch only took over when the tint was not white. glTF tints transmission by the base colour, so other viewers drew the glass grey and FormShot's own reader brought it back with a 0.8 transmission colour. Found in the P17 QA round trip: spheres exported as GLB without the FormShot JSON and reopened came back with transmission_color 0.8 on Clear glass. The tint branch now applies to every full transmission without a volume, as docs/EXPORT.md already describes. Ran: release engine, spheres and sample templates exported with native false and reopened; the reopened glass has transmission_color 1.0 and the CPU render difference against the original drops from 0.0083 to 0.0043 (spheres) and 0.0079 to 0.0053 (sample) mean absolute, 320x180, 32 samples, seed 7.
Three losses left export.model without a word in its warnings, against the rule that a writer reports everything it cannot carry: - usda, usdc and usd exports took the variants option (on by default) and export.formats listed it for them, but the USD writer has no variant sets, so a document's variants vanished silently. The option now applies to glb only, export.formats no longer offers it for USD, and the existing "material variants were left out" warning fires; its hint now names glb instead of telling the user to set an option that could not help. - obj, stl, ply and usdz dropped lights (and obj, stl and ply cameras, stl and ply materials) without a warning; export.model now counts each in one sentence per kind. - the radius of point and spot lights and the angular diameter of the sun have no place in the export scene, so soft shadows came back sharp from every format; the builder now names each such light. Found in the P17 QA format pass: the custom QA document (variants, a point, spot and sun light, two cameras) exported in every format and read back; the usda had no variant data and no warning, and the reopened lights had radius 0. Ran: release engine, the same document and the spheres template exported as glb, obj, stl, ply, usda, usdc and usdz; each reply now carries the new sentences, triangle counts and bounds on reimport are unchanged, and export.formats lists variants for glb alone.
export.model accepts bake_size up to 8192 (its schema and docs/EXPORT.md), but fsh-bake clamps every picture to 4096 texels (MAX_SIZE, docs/BAKE.md), so a request for 5000 or 8192 silently gave 4096 pictures: the two exports wrote identical bytes. The builder now adds a warning naming the requested size and the size used whenever it bakes above MAX_SIZE. Found in the P17 QA bake pass (the disagreement TEST_PLAN asks to record): the custom QA document baked with bake_size 5000 and 8192 gave the same 230528-byte GLB. Ran: release engine; bake_size 5000 now warns "bake_size 5000 is above the baker's largest picture; pictures are baked at 4096 texels square", 4096 and the default give no such warning.
export.model's schema says additionalProperties false, but the command
read only the keys it knew and ignored the rest, so a misspelt option
such as "hiden" exported without the hidden nodes and without a word.
The document commands and material.probe_import refuse unknown fields;
export.model now does the same and names the arguments it takes.
Found in the P17 QA error-reply pass: export.model {path, foo: 1}
answered ok.
Ran: release engine; {foo: 1} and {hiden: true} answer
invalid_arguments naming the known arguments, every valid export of
the format pass still writes, file.export_model (which routes through
export.model with path and format) still writes, and export.web is
unaffected.
Adds the section "P17 QA fixes" at the end of native/HASHOUT_LOG.md with one entry per fix of this branch: clear glass written with a white base colour, the warnings for what each format drops (USD variants, lights, cameras, materials, light sizes), the bake size warning above the baker's limit, and the refusal of unknown export.model arguments, each with what was found and what ran. Ran after the fixes: cargo clippy --workspace --all-targets -D warnings and cargo clippy -p fsh-wasm --target wasm32-unknown-unknown -D warnings from native/, both clean.
The independent P17 QA found the exit ("a GLB export reopens in
FormShot with the same look") broken for every template: a native GLB
carried each material's FormShot JSON but no light's, so the
templates' area lights came back as the wide spot lights glTF holds
(0.0030 to 0.0062 mean difference, hard shadows) and point, spot and
sun sizes came back 0.
With native, the export builder now writes each light's FormShot JSON
(IES profile and links cleared, as both are left out with warnings)
into ExportLight::native; the GLB writer puts it into the glTF light's
extras.formshot as format formshot.light; the glTF reader keeps it in
RawLight::native and the import restores the light from it when it
reads and validates. RawScene::drop_native clears lights too, so
file.import {native: false} still reads plain glTF. With native the
size warning is no longer given and the area light warning says the
JSON keeps the light.
Ran the QA's round trip script, unchanged, with a release engine from
this tree on its seven documents: native 0.0 mean difference on six,
DamagedHelmet 0.000003 (its tangents, as with the original lights
kept); every light reads back equal; plain readings unchanged. cargo
clippy on fsh-io and fsh-commands clean.
A file picked by its extension that is none of the three USD forms (an HTML page saved as .usdz in the QA's samples) went to the usda parser and failed with "a usda layer starts with #usda"; read_usd now refuses it as not a USD file and names the forms it reads. A stage that yields no mesh imported nothing without a word; raw_from_stage now warns, and says when every root prim is an over or a class, a layer meant to change another one (the QA's triangulated.usda). Checked with a release engine from this tree: the HTML file gets the new sentence, triangulated.usda the warning, UsdCookie.usdz imports as before. cargo clippy on fsh-io clean.
Rhino keeps its lights in a light table the reader never walked, so a file holding only a light imported nothing and said nothing. The reader now counts the table's records (chunk 0x10000012, records 0x20008060, read off the QA's light.3dm) and warns that 3DM lights are not read yet. Objects inside block definitions that are skipped (curves, polysurfaces and extrusions without render meshes) were left out of the counts, so a block of them came back as one empty node with no warning; they are now counted once each. Checked before and after on the QA's 3DM samples: light.3dm and blocks.3dm gain their warnings, file3dm_stuff.3dm counts its block members too, mesh.3dm and groups.3dm are unchanged.
export.web_status, export.web_cancel, export.spin_status,
export.spin_cancel and export.formats ignored keys their schemas do not
allow (additionalProperties false), found in the P17 QA. They now
refuse them with invalid_arguments through matimport's check_keys,
made pub(super) rather than copied. The window sends {folder}, {id}
and {} to them.
Checked with a release engine from this tree: {x: 1} on export.formats,
{bogus: true} on export.spin_status and an extra key beside folder on
export.web_status are refused; {} still answers.
docs/EXPORT.md describes the light's extras.formshot (formshot.light), the reopening of area lights and sizes, the independent round trip check, that the USD writer has no variant sets (usda, usdc and usd leave variants out with a warning) and that baking stops at 4096 texels with a warning above. ARCHITECTURE, EXCHANGE-WINDOW, the Exchange wiki page, the README and the harness exchange sub-skill follow. USD.md, RHINO.md and WEB-CONFIGURATOR.md describe the new warnings, the not-USD refusal, the 3DM light and block counts, and what a cancelled picture export leaves in its folder. native/HASHOUT_LOG.md gains "Lead fixes after the P17 QA" with the reasons and what ran for the four fixes before this commit.
FormShot 0.12.0 closes the Exchange phase: model export as GLB, OBJ, STL, PLY, usda, usdc and USDZ through one export scene (export.formats, export.model) with the new crate fsh-bake for looks a format cannot carry; the web configurator and the spin viewer as static folders with status and cancel commands; readers of FormShot's own for USD, Rhino 3DM and IFC; MaterialX and PBR texture set import (material.probe_import, import_mtlx, import_maps); the window's Export Scene, web export and Import Material dialogs; the native option on import; and an independent QA pass with its fixes. CHANGELOG.md gains its section. Version sites moved from 0.11.0 to 0.12.0: VERSION, frontend package.json and the two package-lock.json root entries, version.ts, tauri.conf.json, src-tauri Cargo.toml and its Cargo.lock entry, backend __init__.py, the eighteen native crate manifests (fsh-bake moves from 0.10.0) and their native/Cargo.lock entries, fsh-py pyproject.toml, the formshot-engine usage line, the current-version lines of README (badge, status, Today heading), CONTRIBUTING, NOTICE, SECURITY, ARCHITECTURE, the harness skill (pack version, version bump wording, all crates, the catalogue count), the example export in docs/PREFERENCES.md and the HASHOUT log headers, the command counts (267: 113 document, 38 engine, 101 group commands, 15 aliases, with the export, web, spin and matimport groups added to the lists; formshot-engine catalogue prints 263, without the four aliases), the rendering skill's exchange workflow, and the agent manifest and rendering skill tool reference regenerated by ./formshot agents sync from a 0.12.0 engine build. Run: cargo build --locked --release -p fsh-cli, cargo clippy --locked on the workspace and on fsh-wasm for wasm32 with -D warnings, cargo metadata --locked in src-tauri, formshot-engine version (0.12.0, catalogue prints 263 and lists export.model and material.import_maps), ./formshot agents check (clean), python3 -m json.tool on package.json, package-lock.json, tauri.conf.json and agents/manifest.json, tsc, the harness skill validator (0 FAIL), and the em dash and emoji scan of the change.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
feat: the editors and exchange, model export and new readers (0.12.0)
Summary
uv.*commands andmesh.replace); label placement by dragging in the viewport; Preferences from one table with search, reset and export; a Shortcuts window with recording and key maps; workspaces; presentation mode (F5); and every popup menu kept under the menu bar.export.modelwrites GLB, OBJ with MTL, STL, PLY, usda, usdc and USDZ from one export scene, with FormShot's own baker (fsh-bake) for graphs, labels and projections a format cannot carry. Withnative, a GLB carries each material's and light's FormShot JSON so FormShot reopens it with the same look; every approximation is a warning in the reply.export.webwrites the configurator as a static folder (FormShot's own WebGL viewer, path-traced pictures of every configuration, or both);export.spinrenders a spin viewer through the render queue; both have status and cancel commands.formshot.lightin the glTF light's extras), and the re-check measured 0.0. The QA pass also fixed clear glass in plain glTF and added warnings for what each format drops. Lead fixes after it cover unknown arguments and clearer reader warnings (not-USD files, stages without meshes, 3DM lights, block contents).Commits
Oldest first, release commits at the end of each phase. The short hashes change when
formprsigns the commits.Version
v0.12.0, release commit last;
chore(release): 0.11.0closes the editors phase in the middle of the series. Version sites bumped in each: VERSION, frontend package.json and package-lock.json, version.ts, tauri.conf.json, src-tauri Cargo.toml and Cargo.lock, backend__init__.py, every native crate manifest (18 at 0.12.0, fsh-uv and fsh-bake new) and native/Cargo.lock, fsh-py pyproject.toml, the formshot-engine usage line, the README, CONTRIBUTING, NOTICE, SECURITY and ARCHITECTURE version lines, the harness skill and the HASHOUT log headers. The catalogue has 267 entries (113 document, 38 engine, 101 group commands, 15 aliases);formshot-engine catalogueprints 263.Checks
cargo clippy --locked(workspace, and fsh-wasm for wasm32) with-D warnings,cargo metadata --lockedin src-tauri,tsc --noEmit,vite build,./formshot i18n check,./formshot agents check, the harness skill validator, and the em dash, emoji, z-index and test-file scans all pass.Not run:
maincould not be fetched from this session. The branch is built onfd5f6c0, themainthe uploaded repository carried.Merging
Merge with a merge commit so each commit and its signature stays. Do not squash.