test(web): record high-contrast theme and keyframe dope sheet evidence
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -434,6 +434,10 @@
|
||||
`tools/web/complete/probe-theme.mjs`。
|
||||
- 曲线菜单:手柄自动(ALIGNED→AUTO)、细分(控制点 2→3,全部保持选中),
|
||||
状态均为“原生操作已返回”;证据 `tools/web/complete/probe-curve-menu.mjs`。
|
||||
- 主题高对比度:`data-theme="high-contrast"`,`.area-frame` 计算样式
|
||||
`outline solid 1px rgb(255,212,0)`。
|
||||
- 关键帧/Dope Sheet:自动关键帧在 frame 1 生成 9 条 F-Curve;Dope Sheet
|
||||
出现“关键帧 1”并可选;证据 `tools/web/complete/probe-keyframe-edit.mjs`。
|
||||
- Sequencer:Properties 的 Sequencer Strip Editing → Add Strip 创建
|
||||
`Web MOVIE`(MOVIE);证据 `tools/web/complete/probe-sequencer.mjs`。
|
||||
- Outliner:右键 `Data` 菜单 → 重命名,`PBR Studio Ground` → `GroundRenamed`,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"task": "WBV2-P1425-001",
|
||||
"updatedAt": "2026-11-14T08:45:00+08:00",
|
||||
"updatedAt": "2026-11-14T09:00:00+08:00",
|
||||
"status": "in_progress",
|
||||
"focus": "COMPLETE-TUTORIAL-001 backend export gap (USD/Alembic)",
|
||||
"breakpoint": "blender-5.2.0/source/blender/web_engine/CMakeLists.txt (USD wiring); WASM 6ee2b261",
|
||||
@@ -263,5 +263,15 @@
|
||||
"result": "手柄自动 ALIGNED→AUTO; 细分 points 2→3 (all selected)",
|
||||
"script": "tools/web/complete/probe-curve-menu.mjs",
|
||||
"acceptance": "NOT_CLAIMED"
|
||||
},
|
||||
"themeHighContrast": {
|
||||
"result": "data-theme=high-contrast; .area-frame outline solid 1px rgb(255,212,0)",
|
||||
"acceptance": "NOT_CLAIMED"
|
||||
},
|
||||
"keyframeDopeSheet": {
|
||||
"result": "auto-key at frame 1 creates 9 F-Curves; dope sheet dot 关键帧 1 present/selectable",
|
||||
"note": "a second g after clicking 下一帧 did not register in automation (focus on the button); not claimed",
|
||||
"script": "tools/web/complete/probe-keyframe-edit.mjs",
|
||||
"acceptance": "NOT_CLAIMED"
|
||||
}
|
||||
}
|
||||
|
||||
95
tools/web/complete/probe-keyframe-edit.mjs
Normal file
95
tools/web/complete/probe-keyframe-edit.mjs
Normal file
@@ -0,0 +1,95 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* Focused case: edit mode -> select all -> UV -> 展开(角度) on a mesh.
|
||||
*
|
||||
* node tools/web/complete/probe-keyframe-edit.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: "ProbeKeyEdit.py", console: false } } });
|
||||
}), { requestId, source }, { timeout: 300_000 });
|
||||
};
|
||||
const autoKeyState = async () => {
|
||||
const result = await python(`
|
||||
import bpy, json
|
||||
obj = bpy.context.view_layer.objects.active
|
||||
action = obj.animation_data.action if obj.animation_data else None
|
||||
curves = []
|
||||
if action:
|
||||
for layer in action.layers:
|
||||
for strip in layer.strips:
|
||||
for bag in getattr(strip, 'channelbags', []):
|
||||
for curve in bag.fcurves:
|
||||
curves.append({'path': curve.data_path, 'index': curve.array_index, 'keys': len(curve.keyframe_points), 'frames': [round(point.co[0], 2) for point in curve.keyframe_points], 'values': [round(point.co[1], 3) for point in curve.keyframe_points]})
|
||||
print('AUTOKEY ' + json.dumps({'object': obj.name, 'location': [round(value, 4) for value in obj.location], 'fcurves': curves}))
|
||||
`);
|
||||
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 });
|
||||
await menu("编辑", "偏好设置");
|
||||
await page.getByRole("dialog", { name: "Web Blender 偏好设置" }).waitFor({ timeout: 30_000 });
|
||||
await page.getByRole("button", { name: "动画", exact: true }).click();
|
||||
await page.getByRole("checkbox", { name: "自动关键帧", exact: true }).check();
|
||||
await page.getByRole("button", { name: "关闭偏好设置", exact: true }).click();
|
||||
await page.waitForTimeout(800);
|
||||
await page.keyboard.press("g");
|
||||
await page.waitForTimeout(1800);
|
||||
log("key1", JSON.stringify(await autoKeyState()));
|
||||
await page.getByRole("button", { name: "下一帧", exact: true }).click();
|
||||
await page.waitForTimeout(1200);
|
||||
await page.keyboard.press("g");
|
||||
await page.waitForTimeout(1800);
|
||||
log("key2", JSON.stringify(await autoKeyState()));
|
||||
const dots = await page.locator('.key-dot').count();
|
||||
log("dots", dots, JSON.stringify(await page.locator('.key-dot').evaluateAll((nodes) => nodes.map((node) => node.getAttribute('aria-label')))));
|
||||
if (dots) {
|
||||
await page.locator('.key-dot').first().click();
|
||||
await page.waitForTimeout(800);
|
||||
const frame = await page.evaluate(() => document.querySelector('input[aria-label="当前帧"]')?.value ?? null);
|
||||
log("after dot", frame);
|
||||
}
|
||||
} catch (error) {
|
||||
log("probe error", error instanceof Error ? error.message : String(error));
|
||||
log("state", JSON.stringify(await autoKeyState().catch(() => null)));
|
||||
} finally {
|
||||
log("consoleErrors", JSON.stringify(consoleErrors.slice(-10)));
|
||||
await context.close();
|
||||
await browser.close();
|
||||
}
|
||||
@@ -39,6 +39,24 @@ try {
|
||||
await page.getByRole("button", { name: "关闭偏好设置", exact: true }).click();
|
||||
await page.waitForTimeout(800);
|
||||
log("dark", JSON.stringify(await themeState()));
|
||||
await page.getByRole("button", { name: "编辑", exact: true }).click();
|
||||
await page.getByRole("menuitem", { name: "偏好设置", exact: true }).click();
|
||||
await page.getByRole("button", { name: "主题", exact: true }).click();
|
||||
await page.getByRole("combobox", { name: "主题预设", exact: true }).selectOption("HIGH_CONTRAST");
|
||||
await page.getByRole("button", { name: "关闭偏好设置", exact: true }).click();
|
||||
await page.waitForTimeout(800);
|
||||
const high = await page.evaluate(() => {
|
||||
const frame = document.querySelector('.area-frame');
|
||||
const style = frame ? getComputedStyle(frame) : null;
|
||||
return { theme: document.documentElement.dataset.theme ?? null, outline: style ? `${style.outlineStyle} ${style.outlineWidth} ${style.outlineColor}` : null };
|
||||
});
|
||||
log("high-contrast", JSON.stringify(high));
|
||||
await page.getByRole("button", { name: "编辑", exact: true }).click();
|
||||
await page.getByRole("menuitem", { name: "偏好设置", exact: true }).click();
|
||||
await page.getByRole("button", { name: "主题", exact: true }).click();
|
||||
await page.getByRole("combobox", { name: "主题预设", exact: true }).selectOption("DARK");
|
||||
await page.getByRole("button", { name: "关闭偏好设置", exact: true }).click();
|
||||
await page.waitForTimeout(500);
|
||||
} catch (error) {
|
||||
log("probe error", error instanceof Error ? error.message : String(error));
|
||||
log("state", JSON.stringify(await themeState().catch(() => null)));
|
||||
|
||||
Reference in New Issue
Block a user