Files
workinf_Blender_Wasm/web/tests/fixtures/server-main-snapshots.py
mes123456 f3e21c6b98
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled
chore: checkpoint web Blender migration source, tools and docs
Accumulated uncommitted work: GHOST Web backend, WebGL/GPU web layer,
web workflow engine and protocol, tooling, docs and task records.
Large generated evidence, user-testing archives, build snapshots and
imported test assets remain untracked.

Co-Authored-By: Claude Code <noreply@anthropic.com>
2026-11-10 11:18:01 +08:00

38 lines
1.3 KiB
Python

"""Read canonical object/scene Main state from Chromium-saved blend artifacts."""
import json
import pathlib
import sys
import bpy
directory = pathlib.Path(sys.argv[sys.argv.index("--") + 1])
snapshots = {}
for blend in sorted(directory.glob("*.blend")):
bpy.ops.wm.open_mainfile(filepath=str(blend), load_ui=False)
# Names bind ID references without serializing process-specific addresses.
snapshots[blend.stem] = {
"objects": [
{
"name": obj.name,
"type": obj.type,
"data": obj.data.name if obj.data else None,
"parent": obj.parent.name if obj.parent else None,
"matrix": [list(row) for row in obj.matrix_world],
"collections": sorted(collection.name for collection in obj.users_collection),
}
for obj in sorted(bpy.data.objects, key=lambda item: item.name)
],
"scenes": [
{
"name": scene.name,
"frame": scene.frame_current,
"objects": sorted(obj.name for obj in scene.objects),
}
for scene in sorted(bpy.data.scenes, key=lambda item: item.name)
],
}
(directory / "native-main-snapshots.json").write_text(
json.dumps(snapshots, sort_keys=True, separators=(",", ":")), encoding="utf-8"
)