Complete M16 action select lasso parity
Some checks are pending
M6 deployable RC / quick (push) Waiting to run
M6 deployable RC / chromium (push) Blocked by required conditions
M6 deployable RC / release (push) Blocked by required conditions

This commit is contained in:
mes123456
2026-08-20 23:07:57 -04:00
parent 7440b51394
commit e8ce4f5d0c
15 changed files with 513 additions and 14 deletions

View File

@@ -2193,6 +2193,46 @@ if (task === "M16-GAP-00137") {
process.stdout.write(`generated-gap-ok task=${task} action=${animation.id} selectedFrame=3 channels=${animation.channels.length} desktop=exact saveReopen=exact next=${report.nextTask}\n`);
process.exit(0);
}
if (task === "M16-GAP-00138") {
const fixture = path.join(root, "tests/files/web/generated/M16-GAP-00138-operator-action.select_lasso.blend");
const desktopPath = path.join(root, "tests/golden/M16-GAP-00138/action-select-lasso-desktop-report.json");
fs.mkdirSync(path.dirname(desktopPath), { recursive: true });
const run = spawnSync(process.env.BLENDER_BIN ?? path.join(root, "build_blender_5.2.0/bin/blender"), ["-b", "--factory-startup", "--python", path.join(root, "tools/web/check-action-select-lasso-desktop.py"), "--", fixture, desktopPath], { cwd: root, encoding: "utf8", maxBuffer: 8 * 1024 * 1024 });
assert.equal(run.status, 0, `${run.stdout ?? ""}\n${run.stderr ?? ""}`);
const desktop = JSON.parse(fs.readFileSync(desktopPath, "utf8"));
assert.equal(desktop.saveReopen, "EXACT");
const engine = await factory({ wasmBinary });
const handle = engine._web_engine_create();
open(engine, handle, fs.readFileSync(fixture));
const before = snapshot(engine, handle);
const animation = before.animations?.find((value) => value.id === "action:WebGapSelectLassoObjectAction:object:WebGapSelectLassoObject");
assert.ok(animation);
assert.equal(animation.channels.length, desktop.action.channels.length);
for (const [index, channel] of animation.channels.entries()) {
const expected = desktop.action.channels[index];
assert.equal(channel.path.replace(/\[\d+\]$/, ""), expected.path);
assert.deepEqual(channel.keyframes.map((value) => value.frame), expected.frames);
assert.deepEqual(channel.keyframes.map((value) => value.selected), expected.selected);
}
assert.deepEqual(animation.channels.map((channel) => channel.keyframes.filter((value) => value.selected).map((value) => value.frame)), [[3], [3], [3]]);
const saved = output(engine, handle, engine._web_engine_save_blend, true);
const reopened = engine._web_engine_create();
open(engine, reopened, saved);
assert.deepEqual(snapshot(engine, reopened).animations, before.animations);
const malformed = new Uint8Array([0x42, 0x4c, 0x45, 0x4e, 0x44, 0x45, 0x52]);
const pointer = engine._malloc(malformed.byteLength);
let result;
try { engine.HEAPU8.set(malformed, pointer); result = engine._web_engine_open_blend(handle, pointer, malformed.byteLength); } finally { engine._free(pointer); }
assert.notEqual(result, 0);
assert.deepEqual(snapshot(engine, handle).animations, before.animations);
engine._web_engine_destroy(handle);
engine._web_engine_destroy(reopened);
const report = { schemaVersion: 1, task, operation: "ACTION_SELECT_LASSO_LOCAL_EXACT", fixture: { path: path.relative(root, fixture).replaceAll(path.sep, "/"), sha256: desktop.fixtureSha256 }, desktop: { status: "EXACT", report: path.relative(root, desktopPath).replaceAll(path.sep, "/"), saveReopen: desktop.saveReopen }, wasm: { status: "EXACT", actionId: animation.id, selectedFrame: 3, selectedPerChannel: animation.channels.map((channel) => channel.keyframes.filter((value) => value.selected).map((value) => value.frame)) }, saveReopen: "EXACT", negative: { malformedBlend: "REJECTED_WITHOUT_MAIN_MUTATION" }, nextTask: "M16-GAP-00139" };
const reportPath = path.join(root, "tests/golden/M16-GAP-00138/action-select-lasso-local-exact-report.json");
fs.writeFileSync(reportPath, `${JSON.stringify(report, null, 2)}\n`);
process.stdout.write(`generated-gap-ok task=${task} action=${animation.id} selectedFrame=3 channels=${animation.channels.length} desktop=exact saveReopen=exact next=${report.nextTask}\n`);
process.exit(0);
}
if (task === "M16-GAP-00027") {
const fixture = path.join(root, "tests/files/web/generated/M16-GAP-00027-datablock-WindowManager.blend");
const desktopPath = path.join(root, "tests/golden/M16-GAP-00027/window-manager-desktop-report.json");