Files
workinf_Blender_Wasm/web/tests/fixtures/modifier-stack-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

23 lines
1.3 KiB
Python

import bpy
import json
import pathlib
import sys
request = json.loads(pathlib.Path(sys.argv[sys.argv.index("--") + 1]).read_text())
states = {}
for label, file in request["files"].items():
bpy.ops.wm.open_mainfile(filepath=str(pathlib.Path(file).resolve()))
states[label] = {obj.name: [{
"name": modifier.name, "type": modifier.type,
"viewport": modifier.show_viewport, "render": modifier.show_render,
"values": {key: round(float(getattr(modifier, key)), 6) if isinstance(getattr(modifier, key), float)
else list(getattr(modifier, key)) if not isinstance(getattr(modifier, key), (str, int, bool))
else getattr(modifier, key)
for key in ({"ARRAY": ["count", "use_relative_offset", "relative_offset_displace"],
"BEVEL": ["width", "segments", "profile", "limit_method", "affect"],
"SOLIDIFY": ["thickness", "offset"],
"MIRROR": ["use_axis", "use_clip"],
"SUBSURF": ["levels", "render_levels"]}.get(modifier.type, []))},
} for modifier in obj.modifiers] for obj in sorted(bpy.data.objects, key=lambda item: item.name)}
pathlib.Path(request["output"]).write_text(json.dumps(states, indent=2) + "\n")