"""Test only: the two Season 1 wall systems side by side in the sub bay (starboard: Hallways, port: Interiors). blender -b --factory-startup models/M_Ship_v2_interior_season2.blend --python build/test_s1_walls.py -- The fork itself is not saved. """ import os import sys import bpy sys.dont_write_bytecode = True HERE = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, HERE) import s1 # noqa: E402 from bl_kit import get_collection # noqa: E402 from units import frame, place # noqa: E402 OUT = sys.argv[sys.argv.index("--") + 1] Z2 = -3.36 HUB_X = 3.05 BACK = 8.95 root = bpy.data.objects["M_SHIP_INTERIOR_S2"] old = bpy.data.collections["10.1 | Sub bay | straight lining"] for ob in list(old.all_objects): bpy.data.objects.remove(ob, do_unlink=True) top = bpy.data.collections["10.1 | Sub bay"] col = get_collection("TEST | S1 walls", top) lights = get_collection("TEST | S1 walls | lights", col) k1 = s1.kit() stats = {} L = s1.run_length(5) hw = s1.hall_wall(5) ww = s1.white_wall(5) place(k1, hw.items, col, frame(HUB_X - L / 2, -BACK, Z2, 0.0), zone="test", lights=lights, parent=root, stats=stats, light_scale=s1.LIGHT_SCALE[s1.HALL_MAP] * 0.5) place(k1, ww.items, col, frame(HUB_X + L / 2, BACK, Z2, 180.0), zone="test", lights=lights, parent=root, stats=stats, light_scale=s1.LIGHT_SCALE[s1.INT_MAP] * 0.5) print("TEST placed", stats, "hall items", len(hw.items), "white items", len(ww.items)) en = sorted((round(o.data.energy), o.data.type) for o in bpy.data.objects if o.type == "LIGHT") print("TEST light energies: min %s median %s max %s; exposure %s" % (en[0], en[len(en) // 2], en[-1], bpy.context.scene.view_settings.exposure)) print("TEST new lights:", [(o.data.type, round(o.data.energy)) for o in lights.objects][:6]) for img in bpy.data.images: if img.get("ue_texture") and img.filepath and not img.filepath.startswith("//"): pass bpy.ops.wm.save_as_mainfile(filepath=os.path.abspath(OUT), copy=True) print("TEST saved", OUT)