""" In-place fix for an Anchorage_Station.blend built before 2026-10-13: moves the preview sea plane down so that it no longer cuts through Relay Control's sunken window ring (the ring reaches 1.70 m below the main floor; the sea was drawn at -1.2 m). Nothing else in the file is touched. blender -b --factory-startup Anchorage_Station.blend --python build/fix_sea_level.py [-- ] Back the file up first. The level is also what build_anchorage.py uses from now on (SEA_LEVEL_Z). """ import sys import bpy from mathutils import Vector sys.dont_write_bytecode = True ARGS = sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else [] WANT = float(ARGS[0]) if ARGS else -1.9 sea = bpy.data.objects.get("CONTEXT_sea (preview only)") if sea is None: raise RuntimeError("no sea plane in this file") station = bpy.data.collections["ANCHORAGE STATION"] lowest = 1e9 lowest_name = "" for ob in station.all_objects: if ob.type != "MESH" or ob.get("ue_decal_material"): continue z = min((ob.matrix_world @ Vector(c)).z for c in ob.bound_box) if z < lowest: lowest, lowest_name = z, ob.name before = sea.location.z level = min(WANT, lowest - 0.15) sea.location.z = level bpy.context.preferences.filepaths.save_version = 0 bpy.ops.wm.save_mainfile(compress=True) print("[sea] lowest station geometry %.2f m (%s); sea plane moved from %.2f to %.2f m; saved %s" % (lowest, lowest_name, before, level, bpy.data.filepath))