The e2e asset check now completes: PASS on all six steps - empty maps 9 s, demo build 10 s, review build 9 s, captures 80 s, judge 388 s, review file. Four breakages from the folder move had to be fixed first: - ue_placement and ue_common are siblings of the scripts that import them, but the rewrite put only the tools root on sys.path, so every Unreal commandlet died with ModuleNotFoundError. Both paths are inserted now. - render_screenshots.sh resolved the repository root one level up, so commandlet paths became Tools/Tools/... and the capture step failed in 0 s. - the driver treated a result file left by an earlier run as success, which is how a ten-second 'demo build' passed without building. Result files are unlinked before each step and child output streams to a per-step log file rather than a pipe. - two editors on one project hang instead of failing, so the driver refuses to start while one is running. Also corrects ue_recreate_maps.py: LevelEditorSubsystem.new_level() refuses a path whose package is still in memory and delete_asset() leaves the file on disk, measured create->delete->create returning False. The step now loads each map, destroys every actor, saves, and reports the count it left (0), which is the property the builders actually need. Open question recorded in TODO.md: the rebuilt map holds 409 actors and 613 KB against 600 and 886 KB before, and the ~190 missing ones look like the facade-kit and theatre-trim placements that run as separate steps.
68 lines
2.7 KiB
Python
68 lines
2.7 KiB
Python
# Export the two in-scope north-side background buildings from the OSM blockout.
|
|
#
|
|
# blender -b --factory-startup Art/blender/blockout/blockout-2026-11-06.blend \
|
|
# --python Tools/blender/export_north_buildings.py -- --out /tmp/gigline/north
|
|
#
|
|
# The blockout is already in the shared project frame (metres, X east / Y north /
|
|
# Z up, origin Hollywood x Highland), so exporting each object at its own world
|
|
# position preserves the offset from the hero facade. The site export preset
|
|
# (`ue_metric_v1`) is reused verbatim so the metre->centimetre mapping matches.
|
|
|
|
import argparse
|
|
import os
|
|
import sys
|
|
|
|
import bpy
|
|
_HERE = os.path.dirname(os.path.abspath(__file__))
|
|
sys.path.insert(0, os.path.dirname(_HERE)) # tools root, for _common
|
|
sys.path.insert(0, _HERE) # siblings in this folder (ue_common, ue_placement)
|
|
import fbx_export_preset as fbx_preset # noqa: E402
|
|
|
|
|
|
BUILDINGS = ("TCL Chinese Theatre", "Madame Tussaud's")
|
|
|
|
|
|
def main():
|
|
argv = sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else []
|
|
ap = argparse.ArgumentParser()
|
|
ap.add_argument("--out", default="/tmp/gigline/north")
|
|
args = ap.parse_args(argv)
|
|
os.makedirs(args.out, exist_ok=True)
|
|
|
|
print(f"[north] scene objects: {len(bpy.data.objects)}")
|
|
for name in BUILDINGS:
|
|
obj = bpy.data.objects.get(name)
|
|
if obj is None or obj.type != "MESH":
|
|
print(f"[north] MISSING {name}")
|
|
continue
|
|
bpy.ops.object.select_all(action="DESELECT")
|
|
obj.select_set(True)
|
|
bpy.context.view_layer.objects.active = obj
|
|
mesh = obj.data
|
|
if not mesh.materials:
|
|
mat = bpy.data.materials.new(f"M_{name.replace(' ', '_')}")
|
|
mat.diffuse_color = (0.75, 0.72, 0.68, 1.0)
|
|
mat.use_nodes = False
|
|
mesh.materials.append(mat)
|
|
|
|
# No copy and no Y mirror: the FBX preset already lands Blender +Y
|
|
# (north) on Unreal -Y, and UE north is -Y here (north sidewalk
|
|
# Y -1912..-1053). The old mirror put both buildings on the south side.
|
|
new_obj = obj
|
|
new_mesh = mesh
|
|
bpy.ops.object.select_all(action="DESELECT")
|
|
new_obj.select_set(True)
|
|
bpy.context.view_layer.objects.active = new_obj
|
|
|
|
path = os.path.join(args.out, name.replace(" ", "_").replace("'", "") + ".fbx")
|
|
fbx_preset.export_static(path, selection=True)
|
|
world = new_obj.matrix_world
|
|
zs = [(world @ v.co).z for v in new_mesh.vertices]
|
|
print(f"[north] {name:22} verts {len(new_mesh.vertices):5} z {min(zs):+.2f}..{max(zs):+.2f} m "
|
|
f"-> {path}")
|
|
bpy.data.objects.remove(new_obj, do_unlink=True)
|
|
|
|
print(f"[north] done")
|
|
|
|
|
|
main() |