test(web): record curve handle and subdivide evidence
Co-Authored-By: Claude Code <noreply@anthropic.com>
This commit is contained in:
@@ -432,6 +432,8 @@
|
||||
`[data-theme="light"]`,切换无视觉效果。已归一化为小写/连字符;复测
|
||||
DARK→LIGHT 背景 rgb(24,24,24)→rgb(236,236,236)→DARK;证据
|
||||
`tools/web/complete/probe-theme.mjs`。
|
||||
- 曲线菜单:手柄自动(ALIGNED→AUTO)、细分(控制点 2→3,全部保持选中),
|
||||
状态均为“原生操作已返回”;证据 `tools/web/complete/probe-curve-menu.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:44:00+08:00",
|
||||
"updatedAt": "2026-11-14T08:45: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",
|
||||
@@ -258,5 +258,10 @@
|
||||
"result": "DARK background rgb(24,24,24) → LIGHT rgb(236,236,236) → DARK",
|
||||
"script": "tools/web/complete/probe-theme.mjs",
|
||||
"acceptance": "NOT_CLAIMED"
|
||||
},
|
||||
"curveMenuProbe": {
|
||||
"result": "手柄自动 ALIGNED→AUTO; 细分 points 2→3 (all selected)",
|
||||
"script": "tools/web/complete/probe-curve-menu.mjs",
|
||||
"acceptance": "NOT_CLAIMED"
|
||||
}
|
||||
}
|
||||
|
||||
88
tools/web/complete/probe-curve-menu.mjs
Normal file
88
tools/web/complete/probe-curve-menu.mjs
Normal file
@@ -0,0 +1,88 @@
|
||||
#!/usr/bin/env node
|
||||
/**
|
||||
* Focused case: Add Bezier curve -> edit mode -> select all -> curve extrude,
|
||||
* verified through the product worker's Main.
|
||||
*
|
||||
* node tools/web/complete/probe-curve-menu.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({ response: 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: "ProbeCurveMenu.py", console: false } } });
|
||||
}), { requestId, source }, { timeout: 300_000 });
|
||||
};
|
||||
const curveState = async () => {
|
||||
const result = await python(`
|
||||
import bpy, json
|
||||
obj = bpy.context.view_layer.objects.active
|
||||
data = {'object': obj.name if obj else None, 'type': obj.type if obj else None, 'mode': bpy.context.mode}
|
||||
if obj and obj.type == 'CURVE' and obj.data.splines:
|
||||
data['points'] = [len(spline.bezier_points) for spline in obj.data.splines]
|
||||
data['selected'] = [[point.select_control_point for point in spline.bezier_points] for spline in obj.data.splines]
|
||||
data['handles'] = [[[point.handle_left_type, point.handle_right_type] for point in spline.bezier_points] for spline in obj.data.splines]
|
||||
print('CURVE ' + json.dumps(data))
|
||||
`);
|
||||
const out = result?.response?.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("menuitem", { name: "贝塞尔", exact: true }).click();
|
||||
await page.waitForTimeout(2000);
|
||||
log("added", JSON.stringify(await curveState()));
|
||||
await page.getByRole("button", { name: "操作搜索", exact: true }).click();
|
||||
await page.getByRole("textbox", { name: "搜索 Blender 操作" }).fill("Enter Edit Mode");
|
||||
await page.waitForTimeout(400);
|
||||
await page.getByRole("textbox", { name: "搜索 Blender 操作" }).press("Enter");
|
||||
await page.waitForTimeout(1500);
|
||||
await menu("选择", "全部");
|
||||
await page.waitForTimeout(800);
|
||||
await menu("曲线", "手柄自动");
|
||||
await page.waitForTimeout(1500);
|
||||
log("handles", JSON.stringify(await curveState()));
|
||||
await menu("曲线", "细分");
|
||||
await page.waitForTimeout(1500);
|
||||
log("subdivided", JSON.stringify(await curveState()));
|
||||
} catch (error) {
|
||||
log("probe error", error instanceof Error ? error.message : String(error));
|
||||
log("state", JSON.stringify(await curveState().catch(() => null)));
|
||||
} finally {
|
||||
log("consoleErrors", JSON.stringify(consoleErrors.slice(-12)));
|
||||
await context.close();
|
||||
await browser.close();
|
||||
}
|
||||
Reference in New Issue
Block a user