fix(web): make WASM compositor evaluation produce an image
Initialize the preview RenderResult before compositing and serve the result via a blob URL so the deployment CSP accepts it. Verified RGB→Composite returns 1024×1024 and the Properties button displays it. Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -70,6 +70,18 @@ print('TREE ' + json.dumps({'nodes': nodes, 'links': links}))`);
|
||||
const evaluated = await request({ type: "jsonCommand", cmd: "compositorEvaluate", params: { sceneId } });
|
||||
const payload = evaluated.result?.json;
|
||||
log("evaluate", JSON.stringify({ ok: evaluated.ok, error: evaluated.error, width: payload?.width, height: payload?.height, pixels: typeof payload?.pixelsBase64 === "string" ? payload.pixelsBase64.length : null }));
|
||||
const panel = page.locator('[data-testid="scene-pipeline-settings-workbench"]').first();
|
||||
await panel.waitFor({ timeout: 30_000 });
|
||||
await panel.getByRole("button", { name: "WASM 合成求值", exact: true }).evaluate((element) => element.click());
|
||||
for (let index = 0; index < 120; index++) {
|
||||
await page.waitForTimeout(500);
|
||||
const ui = await page.evaluate(() => {
|
||||
const workbench = document.querySelector('[data-testid="scene-pipeline-settings-workbench"]');
|
||||
return { status: workbench?.querySelector('output[role="status"]')?.textContent ?? "", hasImage: Boolean(workbench?.querySelector('img')) };
|
||||
});
|
||||
if (ui.hasImage || (ui.status && !/求值中/.test(ui.status))) { log("ui", JSON.stringify(ui)); break; }
|
||||
if (index === 119) log("ui timeout", JSON.stringify(ui));
|
||||
}
|
||||
} catch (error) {
|
||||
log("probe error", error instanceof Error ? error.message : String(error));
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user