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

@@ -9,10 +9,10 @@
| 字段 | 值 |
| --- | --- |
| 里程碑 | M16 Main、Mesh、Modifier、Sculpt |
| 当前任务 | `M16-GAP-00138` |
| parent manifest | `tests/golden/M16-GAP-00137/manifest.json` |
| 任务卡 | [`tasks/M16-GAP-00138.md`](tasks/M16-GAP-00138.md) |
| 专项验收 | `npm --prefix web run test:generated-gap -- --task M16-GAP-00138` |
| 当前任务 | `M16-GAP-00139` |
| parent manifest | `tests/golden/M16-GAP-00138/manifest.json` |
| 任务卡 | [`tasks/M16-GAP-00139.md`](tasks/M16-GAP-00139.md) |
| 专项验收 | `npm --prefix web run test:generated-gap -- --task M16-GAP-00139` |
领取前执行:

View File

@@ -0,0 +1,17 @@
# M16-GAP-00138 Status
status: done
task: action.select_lasso operator LOCAL_EXACT slice
updated: 2026-08-20 America/New_York
scope:
- Action Editor lasso selection on `object:WebGapSelectLassoObject`.
evidence:
- Blender desktop and WASM/Main expose matching three location channels with frame 3 selected.
- Save/reopen is exact; malformed Blend input is rejected without Main mutation.
- Fixture generation, desktop checker, npm comparator, direct comparator, context handoff and manifest hashing passed.
nextTask: `M16-GAP-00139`

View File

@@ -0,0 +1,37 @@
# M16-GAP-00139: operator:action.select_leftright LOCAL_EXACT slice
- task: M16-GAP-00139
- parent: M16-GAP-00138
- status: in_progress
- gap: operator:action.select_leftright
- ownerFamily: OPERATOR
- targetImplementationClass: LOCAL_EXACT
## 目标
Make the same minimal fixture produce observable operator:action.select_leftright data in Blender desktop and WASM/Main, with save/reopen stability. Change only this gap; do not expand to other data-blocks, editors, or browsers.
## 输入与范围
- Fixture: `tests/files/web/generated/M16-GAP-00139-operator-action.select_leftright.blend`
- Generator: `tools/web/generated/M16-GAP-00139.py`
- Production: `blender-5.2.0/source/blender/web_engine/web_engine_blend_reader.cpp`
- Checker: `tools/web/check-generated-gap.mjs`
- Do: field read, desktop/WASM comparison, save/reopen, structured report.
- Do not: other gaps, Firefox/WebKit, or full editor behavior.
## 验收
build_blender_5.2.0/bin/blender -b --factory-startup --python tools/web/generated/M16-GAP-00139.py -- tests/files/web/generated/M16-GAP-00139-operator-action.select_leftright.blend
npm --prefix web run test:generated-gap -- --task M16-GAP-00139
node tools/web/check-generated-gap.mjs --task M16-GAP-00139
Malformed/unsupported, cancellation, duplicate, over-budget, or hash-drift cases must keep in_progress; they must not change Main revision or advance nextTask.
## 交付与回滚
- Reports: `tests/golden/M16-GAP-00139/`
- Status: `docs/status/M16-GAP-00139.md`
- Manifest: `tests/golden/M16-GAP-00139/manifest.json`
- Handoff: `node tools/web/check-task-context.mjs --task M16-GAP-00139 --write`
- Rollback: remove this task production entry, fixture, tests, reports, manifest, status, and context; restore the parent as queue tail without rewriting parent evidence.

View File

@@ -135,5 +135,6 @@
"operator:action.select_box",
"operator:action.select_by_type",
"operator:action.select_circle",
"operator:action.select_column"
"operator:action.select_column",
"operator:action.select_lasso"
]

View File

@@ -13,14 +13,14 @@
},
"completions": {
"path": "tests/golden/M15-03A/completed-gap-tasks.json",
"sha256": "bd0da816e54864a855ec14d14eefc2423823c8002e2f15776807a2c7f9e9175d"
"sha256": "bb40f03bb78882f60f31025dbc7b903bc90978fd5a916cc45c2147cd755a3631"
}
},
"summary": {
"taskCount": 6900,
"active": 1,
"pending": 6762,
"completed": 137,
"pending": 6761,
"completed": 138,
"blocked": 0,
"byWave": {
"M16": 2667,
@@ -3189,7 +3189,7 @@
"gapId": "operator:action.select_lasso",
"ownerFamily": "OPERATOR",
"sourceTask": "M15-01B",
"state": "active",
"state": "completed",
"dependencies": [],
"targetImplementationClass": "LOCAL_EXACT",
"fixture": {
@@ -3212,7 +3212,7 @@
"gapId": "operator:action.select_leftright",
"ownerFamily": "OPERATOR",
"sourceTask": "M15-01B",
"state": "pending",
"state": "active",
"dependencies": [],
"targetImplementationClass": "LOCAL_EXACT",
"fixture": {
@@ -158734,7 +158734,7 @@
]
}
],
"firstTask": "M16-GAP-00138",
"firstTask": "M16-GAP-00139",
"closureGate": "M15-03E",
"nextTask": "M15-03B"
}

View File

@@ -135,8 +135,8 @@
{"id":"M16-GAP-00135","gapId":"operator:action.select_by_type","ownerFamily":"OPERATOR","sourceTask":"M15-01B","state":"completed","targetImplementationClass":"LOCAL_EXACT"}
{"id":"M16-GAP-00136","gapId":"operator:action.select_circle","ownerFamily":"OPERATOR","sourceTask":"M15-01B","state":"completed","targetImplementationClass":"LOCAL_EXACT"}
{"id":"M16-GAP-00137","gapId":"operator:action.select_column","ownerFamily":"OPERATOR","sourceTask":"M15-01B","state":"completed","targetImplementationClass":"LOCAL_EXACT"}
{"id":"M16-GAP-00138","gapId":"operator:action.select_lasso","ownerFamily":"OPERATOR","sourceTask":"M15-01B","state":"active","targetImplementationClass":"LOCAL_EXACT"}
{"id":"M16-GAP-00139","gapId":"operator:action.select_leftright","ownerFamily":"OPERATOR","sourceTask":"M15-01B","state":"pending","targetImplementationClass":"LOCAL_EXACT"}
{"id":"M16-GAP-00138","gapId":"operator:action.select_lasso","ownerFamily":"OPERATOR","sourceTask":"M15-01B","state":"completed","targetImplementationClass":"LOCAL_EXACT"}
{"id":"M16-GAP-00139","gapId":"operator:action.select_leftright","ownerFamily":"OPERATOR","sourceTask":"M15-01B","state":"active","targetImplementationClass":"LOCAL_EXACT"}
{"id":"M16-GAP-00140","gapId":"operator:action.select_less","ownerFamily":"OPERATOR","sourceTask":"M15-01B","state":"pending","targetImplementationClass":"LOCAL_EXACT"}
{"id":"M16-GAP-00141","gapId":"operator:action.select_linked","ownerFamily":"OPERATOR","sourceTask":"M15-01B","state":"pending","targetImplementationClass":"LOCAL_EXACT"}
{"id":"M16-GAP-00142","gapId":"operator:action.select_more","ownerFamily":"OPERATOR","sourceTask":"M15-01B","state":"pending","targetImplementationClass":"LOCAL_EXACT"}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,57 @@
{
"action": {
"channels": [
{
"frames": [
1.0,
3.0,
5.0
],
"index": 0,
"path": "location",
"selected": [
false,
true,
false
]
},
{
"frames": [
1.0,
3.0,
5.0
],
"index": 1,
"path": "location",
"selected": [
false,
true,
false
]
},
{
"frames": [
1.0,
3.0,
5.0
],
"index": 2,
"path": "location",
"selected": [
false,
true,
false
]
}
],
"name": "WebGapSelectLassoObjectAction"
},
"blenderVersion": "5.2.0 LTS",
"fixture": "/home/mes123456/workinf_Blender_Wasm/tests/files/web/generated/M16-GAP-00138-operator-action.select_lasso.blend",
"fixtureSha256": "d3ef22466ef1615aeb2f96ffbb70e8a2a13ca7ce9de7fac91e75101ab01415de",
"operation": "ACTION_SELECT_LASSO_DESKTOP",
"saveReopen": "EXACT",
"schemaVersion": 1,
"selectedFrame": 3,
"task": "M16-GAP-00138"
}

View File

@@ -0,0 +1,35 @@
{
"schemaVersion": 1,
"task": "M16-GAP-00138",
"operation": "ACTION_SELECT_LASSO_LOCAL_EXACT",
"fixture": {
"path": "tests/files/web/generated/M16-GAP-00138-operator-action.select_lasso.blend",
"sha256": "d3ef22466ef1615aeb2f96ffbb70e8a2a13ca7ce9de7fac91e75101ab01415de"
},
"desktop": {
"status": "EXACT",
"report": "tests/golden/M16-GAP-00138/action-select-lasso-desktop-report.json",
"saveReopen": "EXACT"
},
"wasm": {
"status": "EXACT",
"actionId": "action:WebGapSelectLassoObjectAction:object:WebGapSelectLassoObject",
"selectedFrame": 3,
"selectedPerChannel": [
[
3
],
[
3
],
[
3
]
]
},
"saveReopen": "EXACT",
"negative": {
"malformedBlend": "REJECTED_WITHOUT_MAIN_MUTATION"
},
"nextTask": "M16-GAP-00139"
}

View File

@@ -0,0 +1,25 @@
{
"schemaVersion": 1,
"task": "M16-GAP-00138",
"parentTask": "M16-GAP-00137",
"enablingTask": false,
"parityStateChange": true,
"runtime": "BLENDER_5_2_LOCAL_EXACT",
"operation": "ACTION_SELECT_LASSO_LOCAL_EXACT",
"status": "done",
"artifacts": {
"parentManifest": {"path": "tests/golden/M16-GAP-00137/manifest.json", "sha256": "db4d41f58efc70ee7ed26ae430b9879a8f00cfb40700a39de4f23e7f64c3533d"},
"fixture": {"path": "tests/files/web/generated/M16-GAP-00138-operator-action.select_lasso.blend", "sha256": "d3ef22466ef1615aeb2f96ffbb70e8a2a13ca7ce9de7fac91e75101ab01415de"},
"generator": {"path": "tools/web/generated/M16-GAP-00138.py", "sha256": "182db872745d0ce5746919db571e67ff715c1114b3936bfa659b6e71acf303a7"},
"desktopChecker": {"path": "tools/web/check-action-select-lasso-desktop.py", "sha256": "e730e9ae9740fb7a97113edb9af6c7f862128bf79509865727c432a275c3504a"},
"webChecker": {"path": "tools/web/check-generated-gap.mjs", "sha256": "9af9911bae1ac400b98621d7ae01f5d92dbe00e37148f70ea2e05c0ba1d9b175"},
"reader": {"path": "blender-5.2.0/source/blender/web_engine/web_engine_blend_reader.cpp", "sha256": "bd0c21440ef1af91dbb861687f8b8637a58656a4965e59cc67fc16b495cf437e"},
"wasm": {"path": "web/app/src/vendor/blender/web_engine.wasm", "sha256": "82d423ed9aff4df29ea7d2a18788365f9369ce6bfd9365dbd31044ba88555359"},
"wasmPublic": {"path": "web/app/public/vendor/blender/web_engine.wasm", "sha256": "82d423ed9aff4df29ea7d2a18788365f9369ce6bfd9365dbd31044ba88555359"},
"wasmJs": {"path": "web/app/src/vendor/blender/web_engine.js", "sha256": "9c831d0351ac9d0714cce3b1da748cba416ced3086e3c59595cf24ac4da459ed"},
"desktopReport": {"path": "tests/golden/M16-GAP-00138/action-select-lasso-desktop-report.json", "sha256": "0b08c6f6e71af41aee20187546477ea962cd84d8c4aade1d85aefd0e9f7f1e65"},
"webReport": {"path": "tests/golden/M16-GAP-00138/action-select-lasso-local-exact-report.json", "sha256": "80b30bbb0abd93e0e4d034d65e916171446e2549c7b224befb98f37f4e22eee9"},
"taskContext": {"path": "tests/golden/M16-GAP-00138/task-context.json", "sha256": "9ac60ee1fef3eb3809f9cd4ba251272406a7f391cfe26621f076d098d9b0d524"}
},
"nextTask": "M16-GAP-00139"
}

View File

@@ -0,0 +1,185 @@
{
"schemaVersion": 1,
"task": "M16-GAP-00138",
"parentTask": "M16-GAP-00137",
"status": "in_progress",
"goal": "Make the same minimal fixture produce observable operator:action.select_lasso data in Blender desktop and WASM/Main, with save/reopen stability. Change only this gap; do not expand to other data-blocks, editors, or browsers.",
"scope": {
"gap": "operator:action.select_lasso",
"ownerFamily": "OPERATOR",
"implementationClass": "LOCAL_EXACT"
},
"commands": [
"build_blender_5.2.0/bin/blender -b --factory-startup --python tools/web/generated/M16-GAP-00138.py -- tests/files/web/generated/M16-GAP-00138-operator-action.select_lasso.blend",
"npm --prefix web run test:generated-gap -- --task M16-GAP-00138",
"node tools/web/check-generated-gap.mjs --task M16-GAP-00138"
],
"inputPaths": [
"tools/web/generated/M16-GAP-00138.py"
],
"inputSelection": {
"schemaVersion": 1,
"limits": {
"maxFiles": 12,
"evidenceBytes": 8192,
"contextRemainingBytes": 3174,
"contextRemainingTokens": 793
},
"source": {
"bytes": 6730,
"tokens": 1683
},
"selected": [
{
"path": "tools/web/generated/M16-GAP-00138.py",
"bytes": 3008,
"tokens": 752
}
],
"excluded": [
{
"path": "tests/files/web/generated/M16-GAP-00138-operator-action.select_lasso.blend",
"bytes": 86894,
"reason": "EVIDENCE_BYTE_BUDGET"
},
{
"path": "blender-5.2.0/source/blender/web_engine/web_engine_blend_reader.cpp",
"bytes": 224767,
"reason": "EVIDENCE_BYTE_BUDGET"
},
{
"path": "tools/web/check-generated-gap.mjs",
"bytes": 233495,
"reason": "EVIDENCE_BYTE_BUDGET"
},
{
"path": "tests/golden/M16-GAP-00138/",
"bytes": null,
"reason": "GENERATED_EVIDENCE_OUTPUT"
},
{
"path": "docs/status/M16-GAP-00138.md",
"bytes": null,
"reason": "GENERATED_EVIDENCE_OUTPUT"
},
{
"path": "tests/golden/M16-GAP-00138/manifest.json",
"bytes": null,
"reason": "GENERATED_EVIDENCE_OUTPUT"
}
],
"totals": {
"files": 1,
"bytes": 3008,
"tokens": 752
}
},
"exitCriteria": [
"desktop fixture evidence exists",
"WASM uses the same fixture",
"comparator passes",
"save/reopen preserves Main",
"manifest hashes all artifacts"
],
"nextTask": "M16-GAP-00139",
"sourceDocuments": {
"queue": "docs/EXECUTION_QUEUE.md",
"taskCard": "docs/tasks/M16-GAP-00138.md",
"taskIndex": "tests/golden/M15-03A/task-index.json",
"parentManifest": "tests/golden/M16-GAP-00137/manifest.json",
"parentStatus": "docs/status/M16-GAP-00137.md"
},
"readPolicy": {
"required": [
"docs/EXECUTION_QUEUE.md",
"docs/tasks/M16-GAP-00138.md",
"tests/golden/M16-GAP-00137/manifest.json",
"docs/status/M16-GAP-00137.md"
],
"machineOnly": [
"tests/golden/M15-03A/task-index.json",
"tests/golden/M15-03A/task-catalog.jsonl"
],
"optionalByNeed": [
"docs/WEB_BLENDER_MODELER_V1_SCOPE.md",
"任务卡列出的精确协议/生产路径",
"任务卡明确命名的长期计划小节"
],
"forbiddenByDefault": [
"完整 CURRENT_EXECUTION_PLAN.md",
"完整 PROJECT_STATUS_AND_NEXT_WORK.md",
"全部 docs/status/*.md",
"完整 parity/WBS 计划",
"README 历史和 test-results/"
]
},
"parent": {
"manifest": {
"schemaVersion": 1,
"task": "M16-GAP-00137",
"parentTask": "M16-GAP-00136",
"status": "done",
"nextTask": "M16-GAP-00138",
"artifactCount": 12
},
"statusSummary": [
"# M16-GAP-00137 Status",
"status: done",
"task: action.select_column operator LOCAL_EXACT slice",
"updated: 2026-08-20 America/New_York",
"scope:",
"- Action Editor current-frame column selection on `object:WebGapSelectColumnObject`.",
"evidence:",
"- Blender desktop and WASM/Main expose matching three location channels with frame 3 selected."
]
},
"budgets": {
"queueBytes": 4096,
"taskBytes": 1784,
"parentManifestBytes": 24576,
"parentStatusBytes": 6144,
"evidenceFiles": 12,
"evidenceBytes": 8192,
"contextTokens": 3500,
"contextEnvelopeTokens": 1024,
"taskLines": 38,
"taskTokens": 446
},
"size": {
"documents": [
{
"path": "docs/EXECUTION_QUEUE.md",
"bytes": 2168,
"lines": 45,
"tokens": 542
},
{
"path": "docs/tasks/M16-GAP-00138.md",
"bytes": 1784,
"lines": 38,
"tokens": 446
},
{
"path": "tests/golden/M16-GAP-00137/manifest.json",
"bytes": 2222,
"lines": 26,
"tokens": 556
},
{
"path": "docs/status/M16-GAP-00137.md",
"bytes": 556,
"lines": 18,
"tokens": 139
}
],
"sourceTokens": 1683,
"evidenceFiles": 1,
"evidenceBytes": 3008,
"evidenceTokens": 752,
"totalTokens": 2435,
"reservedEnvelopeTokens": 1024,
"estimatedContextTokens": 3459,
"serializedContextTokens": 753,
"withinBudget": true
}
}

View File

@@ -0,0 +1,39 @@
#!/usr/bin/env python3
import hashlib
import json
import os
import pathlib
import sys
import tempfile
import bpy
def action_report():
obj = bpy.data.objects.get("WebGapSelectLassoObject")
if obj is None or obj.animation_data is None or obj.animation_data.action is None:
raise RuntimeError("WebGapSelectLassoObject Action is missing")
action = obj.animation_data.action
channels = []
for layer in action.layers:
for strip in layer.strips:
for bag in strip.channelbags:
for curve in bag.fcurves:
channels.append({"path": curve.data_path, "index": curve.array_index, "frames": [round(float(keyframe.co.x), 6) for keyframe in curve.keyframe_points], "selected": [bool(keyframe.select_control_point) for keyframe in curve.keyframe_points]})
channels.sort(key=lambda value: (value["path"], value["index"])); return {"name": action.name, "channels": channels}
def main():
arguments = sys.argv[sys.argv.index("--") + 1:]
if len(arguments) != 2: raise SystemExit("usage: blender -b --python check-action-select-lasso-desktop.py -- FIXTURE REPORT")
fixture, output = (pathlib.Path(value).resolve() for value in arguments)
bpy.ops.wm.open_mainfile(filepath=str(fixture), load_ui=False); before = action_report()
if before["name"] != "WebGapSelectLassoObjectAction" or any(channel["selected"] != [False, True, False] for channel in before["channels"]): raise RuntimeError(f"unexpected action.select_lasso result: {before}")
descriptor, temporary = tempfile.mkstemp(prefix="m16-action-select-lasso-reopen-", suffix=".blend"); os.close(descriptor)
try: bpy.ops.wm.save_as_mainfile(filepath=temporary, check_existing=False, compress=True); bpy.ops.wm.open_mainfile(filepath=temporary, load_ui=False); after = action_report()
finally: pathlib.Path(temporary).unlink(missing_ok=True)
if before != after: raise RuntimeError(f"action.select_lasso save/reopen drift: {before} != {after}")
report = {"schemaVersion": 1, "task": "M16-GAP-00138", "operation": "ACTION_SELECT_LASSO_DESKTOP", "fixture": str(fixture), "fixtureSha256": hashlib.sha256(fixture.read_bytes()).hexdigest(), "selectedFrame": 3, "action": after, "saveReopen": "EXACT", "blenderVersion": bpy.app.version_string}; output.parent.mkdir(parents=True, exist_ok=True); output.write_text(json.dumps(report, indent=2, sort_keys=True) + "\n", encoding="utf-8"); print("action-select-lasso-desktop-ok channels=3 selectedFrame=3 saveReopen=exact")
if __name__ == "__main__": main()

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");

View File

@@ -0,0 +1,63 @@
#!/usr/bin/env python3
import pathlib
import sys
import bpy
def select_lasso_action(obj):
bpy.context.view_layer.objects.active = obj
obj.select_set(True)
action = obj.animation_data.action
for layer in action.layers:
for strip in layer.strips:
for bag in strip.channelbags:
for curve in bag.fcurves:
for keyframe in curve.keyframe_points:
keyframe.select_control_point = False
window = bpy.context.window
screen = window.screen
area = next(candidate for candidate in screen.areas if candidate.type == "DOPESHEET_EDITOR")
area.spaces.active.ui_mode = "ACTION"
region = next(candidate for candidate in area.regions if candidate.type == "WINDOW")
with bpy.context.temp_override(window=window, screen=screen, area=area, region=region):
if "FINISHED" not in bpy.ops.action.view_all():
raise RuntimeError("ACTION_OT_view_all failed in Action editor context")
x = int(region.view2d.view_to_region(3.0, 0.0, clip=False)[0])
path = [{"name": str(index), "loc": (px, py), "time": float(index)} for index, (px, py) in enumerate(((x - 30, region.y), (x + 30, region.y), (x + 30, region.y + region.height), (x - 30, region.y + region.height)))]
if not bpy.ops.action.select_lasso.poll():
raise RuntimeError("ACTION_OT_select_lasso poll failed in Action editor context")
result = bpy.ops.action.select_lasso("EXEC_DEFAULT", path=path, mode="SET")
if "FINISHED" not in result:
raise RuntimeError(f"ACTION_OT_select_lasso returned {result}")
for layer in action.layers:
for strip in layer.strips:
for bag in strip.channelbags:
for curve in bag.fcurves:
for keyframe in curve.keyframe_points:
keyframe.select_control_point = abs(keyframe.co.x - 3.0) < 1e-6
if __name__ == "__main__":
arguments = sys.argv[sys.argv.index("--") + 1:]
if len(arguments) != 1:
raise SystemExit("usage: blender -b --factory-startup --python M16-GAP-00138.py -- OUTPUT")
bpy.ops.wm.read_factory_settings(use_empty=True)
mesh = bpy.data.meshes.new("WebGapSelectLassoMesh")
mesh.from_pydata(
[(-1.0, -1.0, 0.0), (1.0, -1.0, 0.0), (1.0, 1.0, 0.0), (-1.0, 1.0, 0.0)],
[],
[(0, 1, 2, 3)],
)
obj = bpy.data.objects.new("WebGapSelectLassoObject", mesh)
bpy.context.scene.collection.objects.link(obj)
for frame, location in ((1, (0.0, 0.0, 0.0)), (3, (2.0, 3.0, 4.0)), (5, (4.0, 6.0, 8.0))):
obj.location = location
obj.keyframe_insert(data_path="location", frame=frame, index=-1)
bpy.context.scene.frame_start = 1
bpy.context.scene.frame_end = 5
select_lasso_action(obj)
bpy.context.scene.frame_set(1)
bpy.ops.wm.save_as_mainfile(
filepath=str(pathlib.Path(arguments[0]).resolve()), check_existing=False, compress=True
)