Repository navigation
Description
What happened?
Images applied to an item slot with a native material texture pointing at a project file (.../storage/v1/object/public/project-assets/<project>/files/<asset>/<name>.png|jpg) render correctly in the editor, but they are missing from the published bake. In the share link (/s/pvg_… → /viewer/<project>), those surfaces are plain white. They sometimes appear on the very first load (most likely from the browser cache) and disappear on reload.
Inspecting the baked project-bakes/<project>/<hash>/lod0.glb: the item nodes are there, but the painted primitive has baseColorFactor [1,1,1,1] and no baseColorTexture at all. Catalog items in the same GLB keep their textures (KTX2), so texture handling works in general, just not for project-file textures.
Where I think it breaks
From the public code, the client side looks correct:
BakeExporterexports withtextures: 'reference'(packages/editor/src/components/editor/bake-exporter.tsx).getTexture()inpackages/viewer/src/lib/materials.tsstamps project-file textures askind: 'project-asset'.replaceReferencedTextures()inpackages/editor/src/lib/glb-export.tsswaps them for a 1×1 placeholder that carriesextras.pascalTextureRef.GlbScene(packages/viewer/src/components/viewer/glb-scene.tsx) does not resolvepascalTextureRefitself.
So the step that turns placeholders back into real textures happens in the hosted bake pipeline. That pipeline seems to resolve item-glb / library-material refs but drops project-asset ones. Since the final GLB has no texture at all on these primitives (not even the placeholder), the reference is probably stripped rather than left unresolved.
One other possibility worth ruling out: if storageUrl is unset or different in the bake worker, stampPascalTextureRef returns null. In that case the texture would be embedded only if its image had finished loading by capture time (materialTextureLoadState()).
Steps to reproduce
- Upload an image to the project files (
upload_project_file, or from the editor). - Create an authored item with a
PlaneGeometrymesh whose material is namedslot_print. paintthe item, roleprint, with{ properties: { color: '#ffffff' }, texture: { url: '<public project-assets URL of the image>' } }.- The image shows in the editor (
view_sceneconfirms it). - Save a checkpoint, publish it, and open a share link. The surface is white. Download
lod0.glb: there is nobaseColorTextureon that primitive.
Example (live): project project_bGCQgwm3yZkaidS1. The items are the shop sign item_zjui4njgl840ssom and three hanging posters, item_qgte22uxdntaqs7d, item_bf808zemjfqevntf and item_y5q4szowjejepe1s, all with project-assets textures.
Expected behavior
The bake and the share viewer show project-file textures, as the editor does. The same should hold for catalog textures.
Browser & OS
Chrome (stable), macOS 15.
Additional context
- Workaround that does survive the bake: rebuilding the image as per-colour meshes (one plain material per colour, max 29 colours to stay under the 32-material limit). It works, but the result is visibly pixelated.
- On the same projects, the viewer also gets HTTP 404 on 7
/api/projects/<project>/artifacts/<hash>requests (catalog plants,Back-to-wall toilet,Wall-hung basin), on first load and on reload. This may be unrelated.
Activity
Aymericr commentedon Nov 22, 2026
Thanks for the report @fmay-lmwr. The share-viewer bake runs in our hosted pipeline, which isn't part of this repository, so there's no code here to fix it in. I've flagged it to the team. If you can share a scene ID (or a minimal project) where the painted images go missing, that will make it quicker to track down.