fix(web): surface compositor evaluation errors
Normalize ErrorReport code/message instead of rendering [object Object]. Record sequencer Add Strip and compositor error evidence. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -425,6 +425,12 @@
|
|||||||
撤销恢复 scale;证据 `tools/web/complete/probe-transform.mjs`。
|
撤销恢复 scale;证据 `tools/web/complete/probe-transform.mjs`。
|
||||||
- 物理:Physics 面板 Add 创建 RIGID_BODY(ACTIVE,场景 rigidbody_world),
|
- 物理:Physics 面板 Add 创建 RIGID_BODY(ACTIVE,场景 rigidbody_world),
|
||||||
Mass 1.0→5.0 写入 Main;证据 `tools/web/complete/probe-physics.mjs`。
|
Mass 1.0→5.0 写入 Main;证据 `tools/web/complete/probe-physics.mjs`。
|
||||||
|
- Sequencer:Properties 的 Sequencer Strip Editing → Add Strip 创建
|
||||||
|
`Web MOVIE`(MOVIE);证据 `tools/web/complete/probe-sequencer.mjs`。
|
||||||
|
- Compositor:`WASM 合成求值` 在无合成节点组的场景返回结构化
|
||||||
|
`INVALID_ARGUMENT: COMPOSITOR_NODE_GROUP_MISSING: scene has no
|
||||||
|
compositing node group`。此前错误对象被渲染为 `[object Object]`,已在
|
||||||
|
`App.tsx` 规范化 code/message;证据 `probe-compositor.mjs`。
|
||||||
|
|
||||||
## 下一动作
|
## 下一动作
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"schemaVersion": 1,
|
"schemaVersion": 1,
|
||||||
"task": "WBV2-P1425-001",
|
"task": "WBV2-P1425-001",
|
||||||
"updatedAt": "2026-11-14T07:11:00+08:00",
|
"updatedAt": "2026-11-14T07:15:00+08:00",
|
||||||
"status": "in_progress",
|
"status": "in_progress",
|
||||||
"focus": "COMPLETE-TUTORIAL-001 backend export gap (USD/Alembic)",
|
"focus": "COMPLETE-TUTORIAL-001 backend export gap (USD/Alembic)",
|
||||||
"breakpoint": "blender-5.2.0/source/blender/web_engine/CMakeLists.txt (USD wiring); WASM 6ee2b261",
|
"breakpoint": "blender-5.2.0/source/blender/web_engine/CMakeLists.txt (USD wiring); WASM 6ee2b261",
|
||||||
@@ -191,5 +191,16 @@
|
|||||||
"result": "Add RIGID_BODY → ACTIVE + rigidbody_world; Mass 1.0→5.0",
|
"result": "Add RIGID_BODY → ACTIVE + rigidbody_world; Mass 1.0→5.0",
|
||||||
"script": "tools/web/complete/probe-physics.mjs",
|
"script": "tools/web/complete/probe-physics.mjs",
|
||||||
"acceptance": "NOT_CLAIMED"
|
"acceptance": "NOT_CLAIMED"
|
||||||
|
},
|
||||||
|
"sequencerProbe": {
|
||||||
|
"result": "Add Strip → Web MOVIE (MOVIE) in scene sequence editor",
|
||||||
|
"script": "tools/web/complete/probe-sequencer.mjs",
|
||||||
|
"acceptance": "NOT_CLAIMED"
|
||||||
|
},
|
||||||
|
"compositorProbe": {
|
||||||
|
"result": "WASM 合成求值 returns INVALID_ARGUMENT: COMPOSITOR_NODE_GROUP_MISSING (structured after error-text fix)",
|
||||||
|
"fix": "App.tsx normalizes ErrorReport code/message instead of [object Object]",
|
||||||
|
"script": "tools/web/complete/probe-compositor.mjs",
|
||||||
|
"acceptance": "NOT_CLAIMED"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
50
tools/web/complete/probe-compositor.mjs
Normal file
50
tools/web/complete/probe-compositor.mjs
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
/**
|
||||||
|
* Focused case: Render Pipeline -> 切换 Compositor -> WASM 合成求值.
|
||||||
|
*
|
||||||
|
* node tools/web/complete/probe-compositor.mjs --base-url http://127.0.0.1:5176
|
||||||
|
*/
|
||||||
|
import { ASSETS, parseArgs, launchBrowser, newPage, openFile, waitScene } from "../course/lib/lesson-recorder.mjs";
|
||||||
|
|
||||||
|
const args = parseArgs();
|
||||||
|
const BASE = args.baseUrl || "http://127.0.0.1:5176";
|
||||||
|
const browser = await launchBrowser(args.gpu);
|
||||||
|
const { context, page, consoleErrors } = await newPage(browser, { baseUrl: BASE });
|
||||||
|
page.setDefaultTimeout(90_000);
|
||||||
|
const log = (...parts) => console.log(new Date().toISOString().slice(11, 19), ...parts);
|
||||||
|
const state = async () => page.evaluate(() => {
|
||||||
|
const panel = document.querySelector('[data-testid="scene-pipeline-settings-workbench"]');
|
||||||
|
return {
|
||||||
|
panel: panel?.textContent?.slice(0, 200) ?? null,
|
||||||
|
status: document.querySelector('[data-testid="engine-status"]')?.textContent ?? "",
|
||||||
|
evalStatus: panel?.querySelector('output[role="status"]')?.textContent ?? null,
|
||||||
|
hasImage: Boolean(panel?.querySelector('img')),
|
||||||
|
};
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
await openFile(page, ASSETS.studio);
|
||||||
|
await waitScene(page, { objects: 6, timeout: 240_000 });
|
||||||
|
const panel = page.locator('[data-testid="scene-pipeline-settings-workbench"]').first();
|
||||||
|
await panel.waitFor({ timeout: 30_000 });
|
||||||
|
log("start", JSON.stringify(await state()));
|
||||||
|
const toggle = panel.getByRole("button", { name: "切换 Compositor", exact: true });
|
||||||
|
if ((await state()).panel?.startsWith("Render PipelineDirect")) {
|
||||||
|
await toggle.click();
|
||||||
|
await page.waitForTimeout(1200);
|
||||||
|
log("toggled", JSON.stringify(await state()));
|
||||||
|
}
|
||||||
|
await panel.getByRole("button", { name: "WASM 合成求值", exact: true }).click();
|
||||||
|
for (let index = 0; index < 120; index++) {
|
||||||
|
await page.waitForTimeout(500);
|
||||||
|
const current = await state();
|
||||||
|
if (current.hasImage || (current.evalStatus && !/求值中/.test(current.evalStatus))) { log("result", JSON.stringify(current)); break; }
|
||||||
|
if (index === 119) log("timeout", JSON.stringify(current));
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
log("probe error", error instanceof Error ? error.message : String(error));
|
||||||
|
log("state", JSON.stringify(await state().catch(() => null)));
|
||||||
|
} finally {
|
||||||
|
log("consoleErrors", JSON.stringify(consoleErrors.slice(-8)));
|
||||||
|
await context.close();
|
||||||
|
await browser.close();
|
||||||
|
}
|
||||||
77
tools/web/complete/probe-sequencer.mjs
Normal file
77
tools/web/complete/probe-sequencer.mjs
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
/**
|
||||||
|
* Focused case: edit mode -> select all -> UV -> 展开(角度) on a mesh.
|
||||||
|
*
|
||||||
|
* node tools/web/complete/probe-sequencer.mjs --base-url http://127.0.0.1:5176
|
||||||
|
*/
|
||||||
|
import { ASSETS, parseArgs, launchBrowser, newPage, openApp, openFile, waitScene } from "../course/lib/lesson-recorder.mjs";
|
||||||
|
|
||||||
|
const args = parseArgs();
|
||||||
|
const BASE = args.baseUrl || "http://127.0.0.1:5176";
|
||||||
|
const browser = await launchBrowser(args.gpu);
|
||||||
|
const { context, page, consoleErrors } = await newPage(browser, {});
|
||||||
|
page.setDefaultTimeout(90_000);
|
||||||
|
await page.addInitScript(() => {
|
||||||
|
const NativeWorker = window.Worker;
|
||||||
|
window.__probeWorkers = [];
|
||||||
|
window.__probeMessages = [];
|
||||||
|
window.Worker = class extends NativeWorker {
|
||||||
|
constructor(...params) {
|
||||||
|
super(...params);
|
||||||
|
window.__probeWorkers.push(this);
|
||||||
|
this.addEventListener("message", (event) => window.__probeMessages.push(event.data));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
});
|
||||||
|
const log = (...parts) => console.log(new Date().toISOString().slice(11, 19), ...parts);
|
||||||
|
const python = async (source) => {
|
||||||
|
const requestId = `probe-${Date.now()}-${Math.random().toString(36).slice(2)}`;
|
||||||
|
return await page.evaluate(({ requestId, source }) => new Promise((resolve) => {
|
||||||
|
const started = Date.now();
|
||||||
|
const read = () => {
|
||||||
|
const hit = window.__probeMessages.find((message) => message && message.requestId === requestId && message.kind === "result");
|
||||||
|
if (hit) { clearInterval(timer); resolve(hit); return; }
|
||||||
|
if (Date.now() - started > 240000) { clearInterval(timer); resolve({ timeout: true }); }
|
||||||
|
};
|
||||||
|
const timer = setInterval(read, 250);
|
||||||
|
for (const worker of window.__probeWorkers) worker.postMessage({ requestId, command: { type: "jsonCommand", cmd: "pythonExec", params: { source, filename: "ProbeSequencer.py", console: false } } });
|
||||||
|
}), { requestId, source }, { timeout: 300_000 });
|
||||||
|
};
|
||||||
|
const sequencerState = async () => {
|
||||||
|
const result = await python(`
|
||||||
|
import bpy, json
|
||||||
|
scene = bpy.context.scene
|
||||||
|
editor = scene.sequence_editor
|
||||||
|
strips = []
|
||||||
|
if editor:
|
||||||
|
collection = getattr(editor, 'strips', None) or getattr(editor, 'sequences', None)
|
||||||
|
if collection is not None:
|
||||||
|
strips = [(strip.name, strip.type) for strip in collection]
|
||||||
|
print('SEQ ' + json.dumps({'strips': strips}))
|
||||||
|
`);
|
||||||
|
const out = result?.result?.json;
|
||||||
|
const status = await page.evaluate(() => document.querySelector('[data-testid="engine-status"]')?.textContent ?? "");
|
||||||
|
return { state: out?.state, output: out?.output, error: out?.error, status };
|
||||||
|
};
|
||||||
|
const menu = async (label, item) => {
|
||||||
|
await page.getByRole("button", { name: label, exact: true }).click();
|
||||||
|
await page.getByRole("menuitem", { name: item, exact: true }).click();
|
||||||
|
};
|
||||||
|
try {
|
||||||
|
await openApp(page, BASE);
|
||||||
|
await openFile(page, ASSETS.studio);
|
||||||
|
await waitScene(page, { objects: 6, timeout: 240_000 });
|
||||||
|
log("before", JSON.stringify(await sequencerState()));
|
||||||
|
const editor = page.locator('[aria-label="Sequencer Strip Editing"]').first();
|
||||||
|
await editor.waitFor({ timeout: 30_000 });
|
||||||
|
await editor.getByRole("button", { name: "Add Strip", exact: true }).click();
|
||||||
|
await page.waitForTimeout(2000);
|
||||||
|
log("after", JSON.stringify(await sequencerState()));
|
||||||
|
} catch (error) {
|
||||||
|
log("probe error", error instanceof Error ? error.message : String(error));
|
||||||
|
log("state", JSON.stringify(await sequencerState().catch(() => null)));
|
||||||
|
} finally {
|
||||||
|
log("consoleErrors", JSON.stringify(consoleErrors.slice(-10)));
|
||||||
|
await context.close();
|
||||||
|
await browser.close();
|
||||||
|
}
|
||||||
@@ -2989,7 +2989,11 @@ function Properties({ selectedEdgeIndices, nonMeshGeometryBuffers, client, snaps
|
|||||||
setCompositorEvalUrl(canvas.toDataURL("image/png"));
|
setCompositorEvalUrl(canvas.toDataURL("image/png"));
|
||||||
setCompositorEvalStatus(`WASM 合成 ${result.width}×${result.height}`);
|
setCompositorEvalStatus(`WASM 合成 ${result.width}×${result.height}`);
|
||||||
}
|
}
|
||||||
catch (error) { setCompositorEvalStatus(error instanceof Error ? error.message : String(error)); }
|
catch (error) {
|
||||||
|
const failure = error && typeof error === "object" ? error as { code?: unknown; message?: unknown } : null;
|
||||||
|
const message = failure?.message ? String(failure.message) : error instanceof Error ? error.message : String(error);
|
||||||
|
setCompositorEvalStatus(failure?.code ? `${String(failure.code)}: ${message}` : message);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
const assetPreviewOwner = useRef({ url: '', request: 0, active: false });
|
const assetPreviewOwner = useRef({ url: '', request: 0, active: false });
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user