Environment lighting: - ship all eight desktop studiolights/world datasets (WBENV1 float32) and a shared loader used by both the main viewport and the offscreen worker - add the N-panel "studio 环境" selector - rotate the world background together with the environment (backgroundRotation/backgroundIntensity), so camera view and offscreen renders match the desktop Mapping-node behaviour Verification (Chromium, OPFS, NOT_CLAIMED): - environment lighting + 8 world pixel identity - camera-view rotation correspondence (camera matrices, 207 samples) - offscreen vs on-screen background parity after hiding geometry (1305 samples) - metals case extended with material-field OPFS roundtrip - material Principled edits and rename undo/redo - eight studio worlds: pairwise frame differences + luminance rank correlation - undo history depth capped at 64 steps and undo across OPFS save/reopen Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
54 lines
3.2 KiB
JavaScript
54 lines
3.2 KiB
JavaScript
#!/usr/bin/env node
|
|
/** One-off probe: dump the native render panel DOM after a still and an animation. */
|
|
import fs from "node:fs";
|
|
import path from "node:path";
|
|
import { REPO, parseArgs, waitForServer, launchBrowser, newPage, openFile, waitScene } from "./course/lib/lesson-recorder.mjs";
|
|
|
|
const args = parseArgs();
|
|
const BASE = args.baseUrl || `http://127.0.0.1:${args.port}`;
|
|
const SCENE = path.join(REPO, "web/app/public/tutorial/rendering/render-studio.blend");
|
|
const OUT = path.join(REPO, "tests/golden/RENDER-PATHS-001/server-native");
|
|
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
|
|
await waitForServer(`${BASE}/?ui=web`);
|
|
const browser = await launchBrowser(args.gpu);
|
|
const { context } = await newPage(browser, { baseUrl: `${BASE}/?ui=web` });
|
|
const page = context.pages()[0] ?? await context.newPage();
|
|
const log = [];
|
|
page.on("console", (message) => log.push(`${message.type()}: ${message.text()}`));
|
|
page.on("requestfailed", (request) => log.push(`requestfailed: ${request.url()} ${request.failure()?.errorText}`));
|
|
page.on("response", async (response) => {
|
|
if (!response.url().includes("/api/blender-workflow")) return;
|
|
const request = response.request();
|
|
if (request.method() !== "POST") return;
|
|
log.push(`workflow-response ${response.status()} ${response.url()}`);
|
|
});
|
|
await page.locator("main.blender-app").waitFor({ timeout: 180_000 });
|
|
await openFile(page, SCENE);
|
|
await waitScene(page, { objects: 7, timeout: 180_000 });
|
|
await page.getByRole("button", { name: "渲染", exact: true }).click({ force: true });
|
|
await page.getByRole("menuitem", { name: /渲染图像/ }).first().click();
|
|
await page.locator("details.native-render-fallback").first().evaluate((element) => { element.open = true; });
|
|
await sleep(45_000);
|
|
const still = await page.locator(".native-render-panel").evaluate((element) => element.outerHTML);
|
|
fs.writeFileSync(path.join(OUT, "probe-still.html"), still);
|
|
const stillOutput = await page.locator(".native-render-panel .native-workflow-output").innerText().catch(() => "");
|
|
const status = await page.locator('[data-testid="engine-status"]').innerText().catch(() => "");
|
|
await page.screenshot({ path: path.join(OUT, "probe-still.png") });
|
|
|
|
const panel = page.locator(".native-render-panel");
|
|
await panel.locator('select[aria-label="Format"]').selectOption("FFMPEG");
|
|
await panel.locator('input[type="number"]').nth(1).fill("1");
|
|
await panel.locator('input[type="number"]').nth(2).fill("4");
|
|
await panel.getByRole("button", { name: "Render Animation", exact: true }).click({ force: true });
|
|
await sleep(90_000);
|
|
const animation = await page.locator(".native-render-panel").evaluate((element) => element.outerHTML);
|
|
fs.writeFileSync(path.join(OUT, "probe-animation.html"), animation);
|
|
const animationOutput = await page.locator(".native-render-panel .native-workflow-output").innerText().catch(() => "");
|
|
const status2 = await page.locator('[data-testid="engine-status"]').innerText().catch(() => "");
|
|
await page.screenshot({ path: path.join(OUT, "probe-animation.png") });
|
|
fs.writeFileSync(path.join(OUT, "probe-log.txt"), log.join("\n"));
|
|
console.log(JSON.stringify({ stillOutput, status, animationOutput, status2, log: log.slice(-25) }, null, 2));
|
|
await context.close();
|
|
await browser.close();
|