fix: enforce complete building and offline viewer gates

This commit is contained in:
2026-07-10 14:04:10 +08:00
parent cab4d320c0
commit a761175c09
13 changed files with 401 additions and 25 deletions

View File

@@ -914,9 +914,12 @@ def main() -> int:
blend_path = out_dir / f"{args.name}.blend"
glb_path = out_dir / f"{args.name}.glb"
raw_glb_path = out_dir / f"{args.name}.raw.glb"
png_path = out_dir / f"{args.name}.png"
metadata_path = out_dir / "model_metadata.json"
bpy.ops.wm.save_as_mainfile(filepath=str(blend_path))
# Retain a decoder-free GLB for the self-contained r147 offline viewer.
bpy.ops.export_scene.gltf(filepath=str(raw_glb_path), export_format="GLB")
# Draco compression keeps the Web GLB lightweight (typically -85~92% size).
# The Web template registers a DRACOLoader to decode it; keep both in sync.
bpy.ops.export_scene.gltf(
@@ -939,6 +942,7 @@ def main() -> int:
{
"blend": str(blend_path),
"glb": str(glb_path),
"raw_glb": str(raw_glb_path),
"png": str(png_path),
"metadata": str(metadata_path),
"objects": len(bpy.data.objects),