"""Test of the shortened hall in an empty file. blender -b --factory-startup --python build/test_hall.py -- """ import os import sys import bpy sys.dont_write_bytecode = True sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) from bl_kit import Kit, get_collection # noqa: E402 from hall import build_hall # noqa: E402 from units import Demo, frame, place # noqa: E402 out = sys.argv[sys.argv.index("--") + 1] bpy.ops.wm.read_factory_settings(use_empty=True) kit = Kit() demo = Demo("ModSci_Engineer__Example_Dynamic_White") hall = build_hall(demo) root = get_collection("TEST") stats = {} place(kit, hall.items, get_collection("TEST | meshes", root), frame(0, 0, 0), zone="HALL", lights=get_collection("TEST | lights", root), decals=get_collection("TEST | decals", root), stats=stats) lo, hi = hall.bounds() print("TEST hall placed", stats, "centres", [round(v, 2) for v in lo], [round(v, 2) for v in hi]) bpy.ops.wm.save_as_mainfile(filepath=out, compress=True) print("saved", out)