Files
workinf_Blender_Wasm/tools/web/generate-collection-fixture.py
mes123456 10640aeb3c
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
Govern task context and advance execution pointer
2026-08-20 06:02:43 -04:00

21 lines
809 B
Python

#!/usr/bin/env python3
import sys
import bpy
def main(output):
bpy.ops.wm.read_factory_settings(use_empty=True)
parent = bpy.data.collections.new("WebGapCollection")
child = bpy.data.collections.new("WebGapChild")
bpy.context.scene.collection.children.link(parent)
parent.children.link(child)
mesh = bpy.data.meshes.new("WebGapCollectionMesh")
mesh.from_pydata([(0, 0, 0), (1, 0, 0), (0, 1, 0)], [], [(0, 1, 2)])
object_ = bpy.data.objects.new("WebGapCollectionObject", mesh)
child.objects.link(object_)
bpy.ops.wm.save_as_mainfile(filepath=output, compress=True)
if __name__ == "__main__":
args = sys.argv[sys.argv.index("--") + 1:]
if len(args) != 1: raise SystemExit("usage: blender -b --python generate-collection-fixture.py -- OUTPUT")
main(args[0])