Skip to content

Open-source platform for 3D AI agents. Turn text or a photo into a rigged, animated GLB avatar, give it an LLM brain, memory and a wallet, and embed it anywhere with one web component. Remote MCP server, x402 payments, Three.js, browser-native.

feat(forge): carry Forge/Parts Studio models into Scene Studio + changelog

nirholasd1d45fcfe68f
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3a78b4ea6..b8d70d492 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@ Public history for [three.ws](https://three.ws), newest first. New pages come fr
- **Email sign-in works again** — Signing in with an email code on the login and register pages was failing with an authorization error before the code was ever sent. The sign-in flow now completes the security check (a Cloudflare Turnstile verification, invisible for most people) before requesting your code, so the six-digit email code arrives and login works end to end. (`/login`) `[fix, security]`
- **Forge a 3D model right on the homepage** — The homepage now has a live slice of Forge. Type a description of an object — or tap an example — and the real text-to-3D pipeline reconstructs a textured mesh and drops an interactive 3D model into the page, usually in seconds, that you can orbit and download as GLB. Anything you forge there also shows up in the full Forge gallery on the same device. (`/forge`) `[feature]`
- **Forge engine picker now shows live engine health** — The engine buttons on Forge now reflect what's actually running, probed live against each provider — not just whether it's set up. An engine whose upstream is down or unreachable is disabled with the reason in its tooltip, a throttled one shows an amber busy dot, and bring-your-own-key engines (Meshy, Tripo) say so before you pick them. Behind it is a new public health check at /api/forge?health, and the self-hosted Hunyuan3D lane was rewired to its own worker so it no longer fails every prompt by routing to the avatar pipeline. (`/forge`) `[improvement, fix]`
+- **Forge models now carry straight into Scene Studio** — The "what's next" card after a Forge or Parts Studio result used to send you to the studio empty-handed — the model stayed behind. The primary action is now "Open in Scene Studio" and it brings the exact model you just made with it: Scene Studio opens with the GLB already imported, named after your prompt, ready to compose, edit, and export. Your work carries over instead of starting from a blank scene. (`/forge`) `[improvement, fix]`
- **Forge's free Draft engine no longer loses finished models** — Generating on Forge's free Draft engine finished successfully on the server, but the page kept waiting and eventually reported a timeout — the model you'd already paid the wait for never appeared. The free engine returns its result immediately rather than as a background job, and the page now recognizes that, so Draft generations land on screen the moment they're ready. (`/forge`) `[fix]`
- **New /launches page: every agent-launched coin in one live feed** — There is now a public feed of every coin launched by a three.ws agent at /launches — live market caps, graduation badges, buyback rates, and a card linking straight to the agent behind each launch. Agent profile pages also gained a launch history: every coin an agent has ever launched is listed on its page with a live market cap and a link into the public feed. Find it in the nav under Discover → Agent Launches. (`/launches`) `[feature]`
- **Pay a real x402 oracle inside the $THREE town** — The $THREE town in /play now has an Intel Kiosk by the plaza: walk up, press E, and buy live $THREE market intel — price, 24 h change, market cap, and a bullish/bearish/neutral signal — for $0.01 USDC paid from your own wallet over x402, settled on-chain on Solana. The oracle behind it (/api/x402/three-intel) is also listed in the bazaar, so any agent can buy the same feed. The Agent Wallet demo is now linked from the /play menu too. (`/play`) `[feature]`
diff --git a/data/changelog.json b/data/changelog.json
index f2350381d..50e3012b6 100644
--- a/data/changelog.json
+++ b/data/changelog.json
@@ -1118,6 +1118,16 @@
],
"link": "/forge"
},
+ {
+ "date": "2026-06-12",
+ "title": "Forge models now carry straight into Scene Studio",
+ "summary": "The \"what's next\" card after a Forge or Parts Studio result used to send you to the studio empty-handed — the model stayed behind. The primary action is now \"Open in Scene Studio\" and it brings the exact model you just made with it: Scene Studio opens with the GLB already imported, named after your prompt, ready to compose, edit, and export. Your work carries over instead of starting from a blank scene.",
+ "tags": [
+ "improvement",
+ "fix"
+ ],
+ "link": "/forge"
+ },
{
"date": "2026-06-12",
"title": "Sketch-to-3D comes to the Forge",
diff --git a/pages/scan.html b/pages/scan.html
index 6580512f8..156e21f4c 100644
--- a/pages/scan.html
+++ b/pages/scan.html
@@ -1985,9 +1985,16 @@
notifyDone();
showStep('done');
// Surface adjacent features now that the avatar exists (walk it / embed
- // it). The site-wide discovery layer renders the cross-link card.
+ // it). The site-wide discovery layer renders the cross-link card; the
+ // avatar id + model URL let it deep-link this avatar into each target.
document.dispatchEvent(
- new CustomEvent('tws:feature-done', { detail: { feature: 'scan' } }),
+ new CustomEvent('tws:feature-done', {
+ detail: {
+ feature: 'scan',
+ avatarId: _avatarId || null,
+ model: _modelUrl ? { glbUrl: _modelUrl, label: _avatarName || 'Your avatar' } : null,
+ },
+ }),
);
});
diff --git a/public/changelog.json b/public/changelog.json
index 2815fe4a6..c03f7752b 100644
--- a/public/changelog.json
+++ b/public/changelog.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-12T06:13:01.713Z",
+ "generated_at": "2026-06-12T07:15:15.999Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json + data/changelog.json",
"site": {
"name": "three.ws",
@@ -68,6 +68,17 @@
"fix"
]
},
+ {
+ "date": "2026-06-12",
+ "type": "update",
+ "title": "Forge models now carry straight into Scene Studio",
+ "summary": "The \"what's next\" card after a Forge or Parts Studio result used to send you to the studio empty-handed — the model stayed behind. The primary action is now \"Open in Scene Studio\" and it brings the exact model you just made with it: Scene Studio opens with the GLB already imported, named after your prompt, ready to compose, edit, and export. Your work carries over instead of starting from a blank scene.",
+ "link": "/forge",
+ "tags": [
+ "improvement",
+ "fix"
+ ]
+ },
{
"date": "2026-06-12",
"type": "update",
diff --git a/public/changelog.xml b/public/changelog.xml
index e9abeca2c..0b62830a0 100644
--- a/public/changelog.xml
+++ b/public/changelog.xml
@@ -54,6 +54,14 @@
<category>improvement</category>
<description>The engine buttons on Forge now reflect what's actually running, probed live against each provider — not just whether it's set up. An engine whose upstream is down or unreachable is disabled with the reason in its tooltip, a throttled one shows an amber busy dot, and bring-your-own-key engines (Meshy, Tripo) say so before you pick them. Behind it is a new public health check at /api/forge?health, and the self-hosted Hunyuan3D lane was rewired to its own worker so it no longer fails every prompt by routing to the avatar pipeline.</description>
</item>
+ <item>
+ <title>Forge models now carry straight into Scene Studio</title>
+ <link>https://three.ws/forge</link>
+ <guid isPermaLink="false">2026-06-12:Forge models now carry straight into Scene Studio</guid>
+ <pubDate>Fri, 12 Jun 2026 12:00:00 GMT</pubDate>
+ <category>improvement</category>
+ <description>The &quot;what's next&quot; card after a Forge or Parts Studio result used to send you to the studio empty-handed — the model stayed behind. The primary action is now &quot;Open in Scene Studio&quot; and it brings the exact model you just made with it: Scene Studio opens with the GLB already imported, named after your prompt, ready to compose, edit, and export. Your work carries over instead of starting from a blank scene.</description>
+ </item>
<item>
<title>Forge's free Draft engine no longer loses finished models</title>
<link>https://three.ws/forge</link>
diff --git a/public/feature-discovery.js b/public/feature-discovery.js
index 9cf4df1da..1af36be5c 100644
--- a/public/feature-discovery.js
+++ b/public/feature-discovery.js
@@ -41,6 +41,7 @@
'/forge': { label: 'Forge', desc: 'Turn a text prompt into a textured 3D model.' },
'/scan': { label: 'Scan', desc: 'Turn a selfie into a rigged 3D avatar.' },
'/studio': { label: 'Studio', desc: 'Customize your avatar and grab an embed for any site.' },
+ '/scene': { label: 'Scene Studio', desc: 'Import GLBs, compose full 3D scenes, and export.' },
'/play': { label: 'Worlds', desc: 'Drop into a live 3D world and hang out.' },
'/walk': { label: 'Walk', desc: 'Walk your avatar across any page on the site.' },
'/voice': { label: 'Voice Lab', desc: 'Clone a voice and give your agent speech.' },
@@ -65,23 +66,32 @@
// Cross-links shown when a feature finishes (`tws:feature-done`). Every target
// is a confirmed live route; the adjacent action is the natural next step.
+ // When the dispatching page includes the finished model in the event detail
+ // ({ model: { glbUrl, label }, avatarId }), each link deep-links it into the
+ // destination so the session genuinely continues instead of starting blank:
+ // modelParam — query key the destination reads as a direct GLB URL
+ // nameParam — query key for the model's display name (where supported)
+ // idParam — query key the destination reads as a three.ws avatar id;
+ // wins over modelParam when an avatarId is present (a
+ // registered avatar carries name + thumbnail; a bare URL doesn't)
+ // A link with none of these stays a plain route.
var CROSSLINKS = {
forge: { kicker: 'Nice model — what now?', links: [
- { route: '/studio', label: 'Open Studio', primary: true },
- { route: '/embed.html', label: 'Embed editor' },
- { route: '/launchpad', label: 'Deploy onchain' },
- { route: '/play', label: 'Drop it in a world' },
+ { route: '/scene', label: 'Open in Scene Studio', primary: true, modelParam: 'model', nameParam: 'name' },
+ { route: '/embed.html', label: 'Embed editor', modelParam: 'avatar' },
+ { route: '/launchpad', label: 'Deploy onchain', modelParam: 'avatar' },
+ { route: '/play', label: 'Drop it in a world', modelParam: 'avatar' },
] },
segment: { kicker: 'Parts split — what now?', links: [
- { route: '/studio', label: 'Open Studio', primary: true },
+ { route: '/scene', label: 'Open in Scene Studio', primary: true, modelParam: 'model', nameParam: 'name' },
{ route: '/forge', label: 'Forge another model' },
- { route: '/play', label: 'Drop it in a world' },
+ { route: '/play', label: 'Drop it in a world', modelParam: 'avatar' },
{ route: '/docs', label: 'Read the docs' },
] },
scan: { kicker: 'Avatar ready — what now?', links: [
- { route: '/studio', label: 'Open Studio', primary: true },
- { route: '/walk', label: 'Walk your avatar' },
- { route: '/embed.html', label: 'Embed editor' },
+ { route: '/studio', label: 'Open Studio', primary: true, idParam: 'avatar', modelParam: 'model' },
+ { route: '/walk', label: 'Walk your avatar', idParam: 'avatar', modelParam: 'avatarUrl' },
+ { route: '/embed.html', label: 'Embed editor', idParam: 'avatar', modelParam: 'avatar' },
{ route: '/docs', label: 'Read the docs' },
] },
studio: { kicker: 'Widget ready — share it?', links: [
@@ -321,14 +331,39 @@
}
// ── Contextual cross-links after a feature completes ───────────────────────
- function showCrossLinks(feature) {
+ // detail (optional): the tws:feature-done event detail — { model: { glbUrl,
+ // label }, avatarId }. Each link's idParam/modelParam/nameParam (see the
+ // CROSSLINKS comment) turns it into a deep link that opens the destination
+ // with this exact model already loaded.
+ function showCrossLinks(feature, detail) {
var cfg = CROSSLINKS[feature];
if (!cfg) return;
+ var model = detail && detail.model;
+ var glbUrl = model && typeof model.glbUrl === 'string' ? model.glbUrl : '';
+ var avatarId = detail && detail.avatarId ? String(detail.avatarId) : '';
+ var carried = false;
var links = cfg.links
.filter(function (l) { return FEATURES[l.route]; })
- .map(function (l) { return { href: l.route, label: l.label, primary: l.primary }; });
+ .map(function (l) {
+ var href = l.route;
+ if (l.idParam && avatarId) {
+ href += '?' + l.idParam + '=' + encodeURIComponent(avatarId);
+ carried = true;
+ } else if (l.modelParam && glbUrl) {
+ href += '?' + l.modelParam + '=' + encodeURIComponent(glbUrl);
+ if (l.nameParam && model.label) {
+ href += '&' + l.nameParam + '=' + encodeURIComponent(String(model.label).slice(0, 120));
+ }
+ carried = true;
+ }
+ return { href: href, label: l.label, primary: l.primary };
+ });
links.push({ href: EXPLORE_MORE, label: 'Explore more' });
- renderCard({ kicker: cfg.kicker, links: links });
+ renderCard({
+ kicker: cfg.kicker,
+ desc: carried ? 'Each tool opens with this model already loaded.' : null,
+ links: links,
+ });
}
// ── Declarative tooltips: any [data-tip] element (reuses C03 popover) ───────
@@ -384,15 +419,16 @@
var feature = e && e.detail && e.detail.feature;
if (!feature) return;
if (_revealTimer) { clearTimeout(_revealTimer); _revealTimer = null; }
- showCrossLinks(feature);
+ showCrossLinks(feature, e.detail);
});
_revealTimer = setTimeout(showPassivePrompt, REVEAL_DELAY_MS);
}
// ── Public API ─────────────────────────────────────────────────────────────
- // crossLink(feature) lets a page trigger the "what's next" card directly,
- // equivalent to dispatching tws:feature-done.
+ // crossLink(feature, detail?) lets a page trigger the "what's next" card
+ // directly, equivalent to dispatching tws:feature-done — detail may carry
+ // { model: { glbUrl, label }, avatarId } to deep-link the model into targets.
window.twsDiscovery = {
crossLink: showCrossLinks,
dismiss: dismissCard,
diff --git a/public/features.json b/public/features.json
index 417a60130..2ba496f79 100644
--- a/public/features.json
+++ b/public/features.json
@@ -1,5 +1,5 @@
{
- "generated_at": "2026-06-12T06:13:01.691Z",
+ "generated_at": "2026-06-12T07:15:15.985Z",
"generated_by": "scripts/build-page-index.mjs from data/pages.json",
"site": {
"name": "three.ws",
diff --git a/public/sitemap/index.html b/public/sitemap/index.html
index 464e07c5b..250391262 100644
--- a/public/sitemap/index.html
+++ b/public/sitemap/index.html
@@ -42,20 +42,6 @@
.sm-brand img { width: 24px; height: 24px; border-radius: 5px; }
.sm-brand:hover { text-decoration: none; }
</style>
-
- <meta property="og:type" content="website">
- <meta property="og:site_name" content="three.ws">
- <meta property="og:title" content="Sitemap · three.ws">
- <meta property="og:description" content="Human-readable index of every page on three.ws.">
- <meta property="og:url" content="https://three.ws/sitemap">
- <meta property="og:image" content="https://three.ws/og-image.png">
- <meta property="og:image:width" content="1200">
- <meta property="og:image:height" content="630">
- <meta name="twitter:card" content="summary_large_image">
- <meta name="twitter:title" content="Sitemap · three.ws">
- <meta name="twitter:description" content="Human-readable index of every page on three.ws.">
- <meta name="twitter:image" content="https://three.ws/og-image.png">
- <script type="application/ld+json">{"@context":"https://schema.org","@type":"WebPage","name":"Sitemap","description":"Human-readable index of every page on three.ws.","url":"https://three.ws/sitemap","isPartOf":{"@type":"WebSite","name":"three.ws","url":"https://three.ws"}}</script>
</head>
<body>
<header class="sm-topbar">
diff --git a/src/editor/embed-editor.js b/src/editor/embed-editor.js
index a648ffda9..049568c39 100644
--- a/src/editor/embed-editor.js
+++ b/src/editor/embed-editor.js
@@ -76,6 +76,25 @@ function field(labelText, control) {
]);
}
+// A direct GLB/VRM URL (or site path) instead of a three.ws avatar id — the
+// shape Forge/Scan hand off via /embed.html?avatar=<url>. walk-embed loads
+// these directly; chat mode still needs a real agent id.
+function isModelUrl(v) {
+ return /^https?:\/\//i.test(v) || (typeof v === 'string' && v.startsWith('/'));
+}
+
+// Human-readable chip name for a bare model URL: the file name, de-slugged.
+function modelUrlName(v) {
+ try {
+ var path = new URL(v, location.origin).pathname;
+ var file = decodeURIComponent(path.split('/').pop() || '');
+ var name = file.replace(/\.(glb|vrm|gltf)$/i, '').replace(/[-_]+/g, ' ').trim();
+ return name ? name.slice(0, 60) : 'Your 3D model';
+ } catch {
+ return 'Your 3D model';
+ }
+}
+
function mountEmbedEditor(root, opts = {}) {
const cfg = { ...DEFAULTS, ...sanitize(opts) };
// If an avatar was passed in but no explicit mode, default to Walking so
@@ -117,7 +136,7 @@ function mountEmbedEditor(root, opts = {}) {
const avatarTrigger = el('button', { type: 'button', className: 'ee-picker', 'aria-haspopup': 'dialog' });
avatarTrigger.addEventListener('click', openPicker);
- const avatarInput = el('input', { type: 'text', className: 'ee-idinput', placeholder: 'or paste an avatar / agent id', value: cfg.avatar });
+ const avatarInput = el('input', { type: 'text', className: 'ee-idinput', placeholder: 'or paste an avatar / agent id, or a GLB URL', value: cfg.avatar });
avatarInput.addEventListener('input', () => {
cfg.avatar = avatarInput.value.trim();
cfg.avatarMeta = null;
@@ -174,6 +193,13 @@ function mountEmbedEditor(root, opts = {}) {
let _metaToken = 0;
async function resolveAvatarMeta(id) {
const token = ++_metaToken;
+ // Direct model URLs have no avatar record to fetch — name the chip from
+ // the file itself so the deep-linked handoff reads as the user's model.
+ if (isModelUrl(id)) {
+ cfg.avatarMeta = { name: modelUrlName(id), thumbnail_url: null };
+ renderTrigger();
+ return;
+ }
try {
const res = await fetch(`/api/avatars/${encodeURIComponent(id)}`, { credentials: 'include' });
if (!res.ok) return;
@@ -348,6 +374,12 @@ function mountEmbedEditor(root, opts = {}) {
previewFrame.appendChild(previewEmpty);
return;
}
+ // A bare model URL has no agent behind it — chat needs a real agent id.
+ if (cfg.mode === 'chat' && isModelUrl(cfg.avatar)) {
+ previewEmpty.textContent = 'Chat embeds need an agent — pick one from the gallery above.';
+ previewFrame.appendChild(previewEmpty);
+ return;
+ }
const host = el('div', { className: 'ee-host' });
const src = cfg.mode === 'chat' ? chatSrc(cfg, true) : walkSrc(cfg, /* preview */ true);
@@ -431,6 +463,9 @@ function buildSnippet(cfg) {
? '<!-- Enter an agent ID above to generate the chat embed snippet -->'
: '<!-- Enter an avatar ID above to generate the embed snippet -->';
}
+ if (cfg.mode === 'chat' && isModelUrl(cfg.avatar)) {
+ return '<!-- Chat embeds need an agent id — pick an agent from the gallery above -->';
+ }
if (cfg.mode === 'chat') {
return `<iframe\n src="${chatSrc(cfg)}"\n width="${cfg.width}"\n height="${cfg.height}"\n style="border:0;border-radius:16px"\n allow="microphone; autoplay; clipboard-write"\n loading="lazy"><\/iframe>`;
}
diff --git a/src/forge.js b/src/forge.js
index c98f44bfc..d493dcab3 100644
--- a/src/forge.js
+++ b/src/forge.js
@@ -1002,7 +1002,11 @@ function showResult(glbUrl, label, meta) {
document.dispatchEvent(
new CustomEvent('forge:model-ready', { detail: { glbUrl, label } }),
);
- document.dispatchEvent(new CustomEvent('tws:feature-done', { detail: { feature: 'forge' } }));
+ document.dispatchEvent(
+ new CustomEvent('tws:feature-done', {
+ detail: { feature: 'forge', model: { glbUrl, label } },
+ }),
+ );
if (els.forgeShareBtn) {
els.forgeShareBtn.dataset.sharePrompt = label;
}
diff --git a/src/home-forge.js b/src/home-forge.js
index e4038a8de..0b12893c1 100644
--- a/src/home-forge.js
+++ b/src/home-forge.js
@@ -211,7 +211,11 @@ function showResult(glbUrl, prompt) {
}
// Same signal the full page emits — the discovery layer turns it into a
// "what's next?" card (embed it, drop it in a world, …).
- document.dispatchEvent(new CustomEvent('tws:feature-done', { detail: { feature: 'forge' } }));
+ document.dispatchEvent(
+ new CustomEvent('tws:feature-done', {
+ detail: { feature: 'forge', model: { glbUrl, label: prompt } },
+ }),
+ );
}
async function run(prompt) {
diff --git a/src/scene-studio/main.js b/src/scene-studio/main.js
index 1058abbb9..9068be4b0 100644
--- a/src/scene-studio/main.js
+++ b/src/scene-studio/main.js
@@ -13,6 +13,7 @@ document.documentElement.setAttribute('data-theme', 'dark');
import * as THREE from 'three';
import { Editor } from './vendor/js/Editor.js';
+import { AddObjectCommand } from './vendor/js/commands/AddObjectCommand.js';
import { Viewport } from './vendor/js/Viewport.js';
import { Toolbar } from './vendor/js/Toolbar.js';
import { Script } from './vendor/js/Script.js';
@@ -98,6 +99,8 @@ editor.storage.init(function () {
if (selected !== undefined) {
editor.selectByUuid(selected);
}
+
+ importModelFromQuery();
});
//
@@ -137,6 +140,61 @@ editor.storage.init(function () {
signals.historyChanged.add(saveState);
});
+// Deep-link: /scene?model=<glb_url>&name=<label> — e.g. the "Open in Scene
+// Studio" hand-off after Forge or Parts Studio finishes. The GLB is fetched
+// and added through AddObjectCommand (undo, autosave, and the outliner behave
+// as if the user imported it) — deliberately skipping the editor's
+// add-or-replace import dialog, since a deep-link arrival has an unambiguous
+// intent: add this model to the scene. The query is then stripped from the
+// address bar so a reload doesn't import a duplicate — autosave already
+// persists the object.
+async function importModelFromQuery() {
+ const params = new URLSearchParams(window.location.search);
+ const modelUrl = params.get('model');
+ if (!modelUrl) return;
+ if (!/^https:\/\//.test(modelUrl) && !modelUrl.startsWith('/')) return;
+
+ window.history.replaceState(null, '', window.location.pathname + window.location.hash);
+
+ try {
+ const res = await fetch(modelUrl);
+ if (!res.ok) throw new Error('HTTP ' + res.status);
+ const contents = await res.arrayBuffer();
+
+ // Same decoder wiring as the vendored Loader's createGLTFLoader.
+ const [{ GLTFLoader }, { DRACOLoader }, { KTX2Loader }, { MeshoptDecoder }] = await Promise.all([
+ import('three/addons/loaders/GLTFLoader.js'),
+ import('three/addons/loaders/DRACOLoader.js'),
+ import('three/addons/loaders/KTX2Loader.js'),
+ import('three/addons/libs/meshopt_decoder.module.js'),
+ ]);
+ const dracoLoader = new DRACOLoader();
+ dracoLoader.setDecoderPath('/scene-studio/draco/gltf/');
+ const ktx2Loader = new KTX2Loader();
+ ktx2Loader.setTranscoderPath('/scene-studio/basis/');
+ editor.signals.rendererDetectKTX2Support.dispatch(ktx2Loader);
+ const loader = new GLTFLoader();
+ loader.setDRACOLoader(dracoLoader);
+ loader.setKTX2Loader(ktx2Loader);
+ loader.setMeshoptDecoder(MeshoptDecoder);
+
+ const result = await loader.parseAsync(contents, '');
+ const urlBase = decodeURIComponent(modelUrl.split('?')[0].split('/').pop() || '');
+ const label = (params.get('name') || urlBase.replace(/\.(glb|gltf)$/i, '') || 'Model')
+ .replace(/\s+/g, ' ').trim().slice(0, 64) || 'Model';
+ const object = result.scene;
+ object.name = label;
+ object.animations.push(...result.animations);
+ editor.execute(new AddObjectCommand(editor, object));
+ editor.selectByUuid(object.uuid);
+
+ dracoLoader.dispose();
+ ktx2Loader.dispose();
+ } catch (error) {
+ alert('Could not load the handed-off model (' + error.message + '). You can drag the GLB file into the editor instead.');
+ }
+}
+
//
document.addEventListener('dragover', function (event) {
diff --git a/src/segment.js b/src/segment.js
index e01319bbc..c49db270e 100644
--- a/src/segment.js
+++ b/src/segment.js
@@ -492,7 +492,11 @@ async function run(meshUrl) {
els.downloadGlb.href = done.result_url;
els.downloadGlb.setAttribute('download', `${safeFileName('segmented')}.glb`);
stopElapsed();
- document.dispatchEvent(new CustomEvent('tws:feature-done', { detail: { feature: 'segment' } }));
+ document.dispatchEvent(
+ new CustomEvent('tws:feature-done', {
+ detail: { feature: 'segment', model: { glbUrl: done.result_url, label: 'Segmented model' } },
+ }),
+ );
} catch (err) {
if (pollAbort) return;
stopElapsed();
diff --git a/src/walk-embed.js b/src/walk-embed.js
index 06d18f0cc..d4236e7d0 100644
--- a/src/walk-embed.js
+++ b/src/walk-embed.js
@@ -66,6 +66,12 @@ const ENVIRONMENTS = {
function resolveAvatarUrl() {
const id = params.get('avatar');
if (!id) return AVATAR_URL_DEFAULT;
+ // A direct GLB/VRM URL or site path loads as-is — this is how Forge/Scan
+ // hand a just-generated model into the embed editor (?avatar=<glb url>),
+ // the same passthrough the /play worlds use (src/game/avatar-rig.js).
+ // Same-origin /cdn/ paths stay loadable from third-party iframes because
+ // the iframe itself is served from three.ws.
+ if (/^https?:\/\//i.test(id) || id.startsWith('/')) return id;
// Go through the same-origin GLB proxy (api/avatars/[id]/glb) instead
// of the metadata JSON. The proxy streams the bytes with
// `Access-Control-Allow-Origin: *` so hosts on any origin can iframe