asset: two north-side background buildings across Hollywood Blvd
- TCL Chinese Theatre (6925) and Madame Tussaud's (6933) exported from the verified OSM blockout with ue_metric_v1 (export_north_buildings.py), with a Y-mirror so they land north of the road, across from the hero facade. - ue_import_north_buildings.py imports + stages them in the DemoMap as North_TCL_Chinese / North_Madame_Tussauds (TCL Y 1802..9431, Tussaud's 1888..7586; hero at Y -1450, road centreline ~0). - render_screenshots.sh now also runs the DemoMap capture pass; added a demo-north-buildings camera, so the new buildings get a review shot. - README/roadmap updated; flat facade materials pending the 0.1.4 patch.
This commit is contained in:
1 parent
f7f01fd077
commit
4401bb2f67
12 files changed
+259
-18
No files matched your search
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
-1
@@ -96,7 +96,7 @@ The MPFB character asset (idle pose + warm skin, done below) is planned as the t
|
|||||||
- [x] Download reference photography for the two north-side buildings inside the 50 m buffer — TCL Chinese Theatre (OSM way 424105908, 6925 Hollywood Blvd) and Madame Tussaud's (way 424105889, 6933 Hollywood Blvd). Done 2026-11-06 with `Tools/commons_fetch.py` against the Wikimedia Commons API: eleven frames in the local `Art/reference/north-chinese/` and `Art/reference/north-tussauds/`, provenance in each `sidecar.json`, nothing committed.
|
- [x] Download reference photography for the two north-side buildings inside the 50 m buffer — TCL Chinese Theatre (OSM way 424105908, 6925 Hollywood Blvd) and Madame Tussaud's (way 424105889, 6933 Hollywood Blvd). Done 2026-11-06 with `Tools/commons_fetch.py` against the Wikimedia Commons API: eleven frames in the local `Art/reference/north-chinese/` and `Art/reference/north-tussauds/`, provenance in each `sidecar.json`, nothing committed.
|
||||||
- [x] Model hero façade for the El Capitan Entertainment Centre site. **Second pass built 2026-11-07** (proportions recalibrated from the 2009 photograph: entablature 3.4 m, parapet 2.2 m, architrave and cornice bands, square pedestals — the first pass had 5.7 m of blank wall above the capitals and read as a warehouse). **First pass built 2026-11-07** (`Tools/hero_facade_build.py` → `Art/blender/hero/hero-facade-2026-11-07.blend` + JSON part report with evidence per part → `Tools/ue_hero_facade_import.py` → `/Game/Hollywood/ElCapitan/SM_HeroFacade`, 1892 tris, 4 materials, placed on the measured building line). Six columns at 4.96 m over the 25.75 m frontage, plinth, three portal flights (5 risers, not the old 8), entablature 2.2 m, parapet 1.6 m with motto band and medallions. **Screenshot review pending** (`Screenshots/review-04`, `review-05`). Next pass: portal recesses read from the street, banner and window placement, then materials.
|
- [x] Model hero façade for the El Capitan Entertainment Centre site. **Second pass built 2026-11-07** (proportions recalibrated from the 2009 photograph: entablature 3.4 m, parapet 2.2 m, architrave and cornice bands, square pedestals — the first pass had 5.7 m of blank wall above the capitals and read as a warehouse). **First pass built 2026-11-07** (`Tools/hero_facade_build.py` → `Art/blender/hero/hero-facade-2026-11-07.blend` + JSON part report with evidence per part → `Tools/ue_hero_facade_import.py` → `/Game/Hollywood/ElCapitan/SM_HeroFacade`, 1892 tris, 4 materials, placed on the measured building line). Six columns at 4.96 m over the 25.75 m frontage, plinth, three portal flights (5 risers, not the old 8), entablature 2.2 m, parapet 1.6 m with motto band and medallions. **Screenshot review pending** (`Screenshots/review-04`, `review-05`). Next pass: portal recesses read from the street, banner and window placement, then materials.
|
||||||
- [ ] Model surrounding block frontage.
|
- [ ] Model surrounding block frontage.
|
||||||
- [-] Model simplified background buildings directly across Hollywood Boulevard. Owner: this session (01a1b26b). Taking the two in-scope north-side buildings — TCL Chinese Theatre (way 424105908, 6925) and Madame Tussaud's (way 424105889, 6933) — from the verified OSM blockout volumes, cleaned and exported with `ue_metric_v1`. Source positions measured: TCL centre (Blender local −206.50, 56.20), Tussaud's (−249.47, 47.20); hero façade placed in the demo map at Unreal (−10722.5, −1443.0).
|
- [x] Model simplified background buildings directly across Hollywood Boulevard. Done 2026-11-07, the two in-scope north-side buildings — TCL Chinese Theatre (SM_TCL_Chinese_Theatre) and Madame Tussaud's (SM_Madame_Tussauds) — taken from the verified OSM blockout volumes and exported with `ue_metric_v1`, with a Y-mirror so they land north of Hollywood Blvd across the street from the hero (TCL spans Unreal Y 1802..9431, Tussaud's 1888..7586; road centreline ≈ 0, hero façade at Y −1450). Staged in the DemoMap as `North_TCL_Chinese` / `North_Madame_Tussauds`; demo shot `review-03-demo-north-buildings` captured. Simple flat facade materials (surfaces are the `0.1.4` patch).
|
||||||
- [-] Build sidewalks, roads, and collision meshes. Terrain, road, sidewalks and kerbs exist (`Art/blender/terrain/`, `street/`) and are assembled in `site/site-2026-11-06.blend`; collision and details (crossing markings, kerb radii, aprons) are not built. Ground must follow the DEM: 3.94 m fall along the block, ~2 % crown between the gutters at ±10–11 m from the centreline, north sidewalk higher than south. Kerb height is an unresolved assumption — the DEM does not resolve it (`Geo/verification/2026-11-06-cross-sections.md`).
|
- [-] Build sidewalks, roads, and collision meshes. Terrain, road, sidewalks and kerbs exist (`Art/blender/terrain/`, `street/`) and are assembled in `site/site-2026-11-06.blend`; collision and details (crossing markings, kerb radii, aprons) are not built. Ground must follow the DEM: 3.94 m fall along the block, ~2 % crown between the gutters at ±10–11 m from the centreline, north sidewalk higher than south. Kerb height is an unresolved assumption — the DEM does not resolve it (`Geo/verification/2026-11-06-cross-sections.md`).
|
||||||
- [ ] Materials and look development for all exported assets.
|
- [ ] Materials and look development for all exported assets.
|
||||||
|
|
||||||
|
|||||||
@@ -117,6 +117,7 @@ Rendered from `/Game/Hollywood/DemoMap`, the walkable level rather than the revi
|
|||||||
| `demo/review-00-demo-spawn-view.png` | The player's own spawn view: north sidewalk, 20 m back, the full 14.5 m of the hero façade across the road |
|
| `demo/review-00-demo-spawn-view.png` | The player's own spawn view: north sidewalk, 20 m back, the full 14.5 m of the hero façade across the road |
|
||||||
| `demo/review-01-demo-street-level.png` | Close street level: portals, flights, banners and the colonnade from the road |
|
| `demo/review-01-demo-street-level.png` | Close street level: portals, flights, banners and the colonnade from the road |
|
||||||
| `demo/review-02-demo-crossing.png` | From the west end looking along the block |
|
| `demo/review-02-demo-crossing.png` | From the west end looking along the block |
|
||||||
|
| `demo/review-03-demo-north-buildings.png` | **New 2026-11-07:** the two north-side background buildings (TCL Chinese Theatre 6925, Madame Tussaud's 6933) seen from the south sidewalk across Hollywood Blvd — their frontage and mass. From the OSM blockout volumes, mirrored to the north side of the road. |
|
||||||
|
|
||||||
Known issues in this build, visible in the shots and already on the roadmap:
|
Known issues in this build, visible in the shots and already on the roadmap:
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,91 @@
|
|||||||
|
# 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/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
|
||||||
|
|
||||||
|
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)
|
||||||
|
|
||||||
|
# The blockout sits with the hero (6840, south side) at negative Y. The two
|
||||||
|
# in-scope north buildings must land ACROSS Hollywood Blvd at positive Y in
|
||||||
|
# Unreal. Mirror the exported geometry across the road centreline (Y=0) and
|
||||||
|
# reverse winding; the FBX exporter does not do this for us.
|
||||||
|
new_mesh = mesh.copy()
|
||||||
|
new_obj = obj.copy()
|
||||||
|
new_obj.data = new_mesh
|
||||||
|
new_obj.matrix_world = obj.matrix_world.copy()
|
||||||
|
bpy.context.collection.objects.link(new_obj)
|
||||||
|
import mathutils as mu
|
||||||
|
world = new_obj.matrix_world
|
||||||
|
inv = world.inverted()
|
||||||
|
for v in new_mesh.vertices:
|
||||||
|
wp = world @ v.co
|
||||||
|
wp.y = -wp.y
|
||||||
|
v.co = inv @ wp
|
||||||
|
for poly in new_mesh.polygons:
|
||||||
|
verts = list(poly.vertices)
|
||||||
|
verts.reverse()
|
||||||
|
poly.vertices = verts
|
||||||
|
new_mesh.update()
|
||||||
|
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")
|
||||||
|
bpy.ops.export_scene.fbx(
|
||||||
|
filepath=path,
|
||||||
|
use_selection=True,
|
||||||
|
object_types={"MESH"},
|
||||||
|
apply_unit_scale=True,
|
||||||
|
apply_scale_options="FBX_SCALE_NONE",
|
||||||
|
axis_forward="-Y",
|
||||||
|
axis_up="Z",
|
||||||
|
use_space_transform=True,
|
||||||
|
use_mesh_modifiers=True,
|
||||||
|
mesh_smooth_type="OFF",
|
||||||
|
path_mode="AUTO",
|
||||||
|
bake_space_transform=False,
|
||||||
|
)
|
||||||
|
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()
|
||||||
+30
-13
@@ -2,38 +2,55 @@
|
|||||||
# Render in-game screenshots for visual review into <repo>/Screenshots/ (gitignored).
|
# Render in-game screenshots for visual review into <repo>/Screenshots/ (gitignored).
|
||||||
#
|
#
|
||||||
# Usage: Tools/render_screenshots.sh
|
# Usage: Tools/render_screenshots.sh
|
||||||
# Rebuilds /Game/Test/ReviewMap from current content, runs the game on it
|
# Rebuilds /Game/Test/ReviewMap and /Game/Hollywood/DemoMap (shot lists), runs
|
||||||
# (the GigLineShotActor walks three cameras, captures, quits), then copies
|
# the game on each map (the GigLineShotActor walks the cameras, captures, quits),
|
||||||
# the PNGs into Screenshots/.
|
# and copies the PNGs into Screenshots/. PNGs are never committed.
|
||||||
set -euo pipefail
|
set -euo pipefail
|
||||||
|
|
||||||
REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||||
ENGINE="${UE_ENGINE_DIR:-/run/media/system/DATA/Engines/UE_5.8.4}"
|
ENGINE="${UE_ENGINE_DIR:-/run/media/system/DATA/Engines/UE_5.8.4}"
|
||||||
PROJ="$REPO/Game/GigLine/GigLine.uproject"
|
PROJ="$REPO/Game/GigLine/GigLine.uproject"
|
||||||
|
|
||||||
echo "== 1/3 build review map =="
|
echo "== 1/4 build review + demo shot maps =="
|
||||||
cd "$ENGINE"
|
cd "$ENGINE"
|
||||||
./Engine/Binaries/Linux/UnrealEditor-Cmd "$PROJ" \
|
./Engine/Binaries/Linux/UnrealEditor-Cmd "$PROJ" \
|
||||||
-run=pythonscript -script="$REPO/Tools/ue_build_review_map.py" \
|
-run=pythonscript -script="$REPO/Tools/ue_build_review_map.py" \
|
||||||
-nullrhi -unattended -nopause -stdout
|
-nullrhi -unattended -nopause -stdout
|
||||||
cat /tmp/ue-review-map-result.txt
|
cat /tmp/ue-review-map-result.txt | tail -3
|
||||||
|
|
||||||
echo "== 2/3 run game on review map =="
|
run_capture() {
|
||||||
# -windowed -NoSplash: a fullscreen swap can leave the first frame uncaptured.
|
local map="$1" label="$2"
|
||||||
./Engine/Binaries/Linux/UnrealEditor-Cmd "$PROJ" /Game/Test/ReviewMap \
|
echo "== capture: $label =="
|
||||||
|
./Engine/Binaries/Linux/UnrealEditor-Cmd "$PROJ" "$map" \
|
||||||
-game -windowed -ResX=1920 -ResY=1080 -nopause -nosplash -stdout
|
-game -windowed -ResX=1920 -ResY=1080 -nopause -nosplash -stdout
|
||||||
|
}
|
||||||
|
|
||||||
echo "== 3/3 collect screenshots =="
|
echo "== 2/4 run game on review map (hero/scene shots) =="
|
||||||
mkdir -p "$REPO/Screenshots"
|
run_capture "/Game/Test/ReviewMap" "review"
|
||||||
rm -f "$REPO"/Screenshots/review-*.png
|
|
||||||
|
echo "== 3/4 run game on demo map (walkable-demo shots) =="
|
||||||
|
run_capture "/Game/Hollywood/DemoMap" "demo"
|
||||||
|
|
||||||
|
echo "== 4/4 collect screenshots =="
|
||||||
|
mkdir -p "$REPO/Screenshots/demo"
|
||||||
|
rm -f "$REPO"/Screenshots/review-*.png "$REPO"/Screenshots/demo/review-*.png
|
||||||
found=0
|
found=0
|
||||||
for src in \
|
for src in \
|
||||||
"$REPO/Game/GigLine/Saved/Screenshots"/*/review-*.png \
|
"$REPO/Game/GigLine/Saved/Screenshots"/*/review-*.png \
|
||||||
"$REPO/Game/GigLine/Saved/Screenshots"/*/*/review-*.png \
|
"$REPO/Game/GigLine/Saved/Screenshots"/*/*/review-*.png \
|
||||||
"$HOME/.config/Epic/GigLine/Saved/Screenshots"/*/review-*.png; do
|
"$HOME/.config/Epic/GigLine/Saved/Screenshots"/*/review-*.png; do
|
||||||
[ -e "$src" ] || continue
|
[ -e "$src" ] || continue
|
||||||
cp -f "$src" "$REPO/Screenshots/"
|
name=$(basename "$src")
|
||||||
|
if [[ "$name" == review-?("")-demo-* || "$name" == review-*-demo-* || "$name" == review-0?-demo-* ]] \
|
||||||
|
|| [[ "$name" == *demo-* ]]; then
|
||||||
|
cp -f "$src" "$REPO/Screenshots/demo/$name"
|
||||||
|
else
|
||||||
|
cp -f "$src" "$REPO/Screenshots/$name"
|
||||||
|
fi
|
||||||
found=1
|
found=1
|
||||||
done
|
done
|
||||||
[ "$found" = "1" ] || { echo "ERROR: no review-*.png found"; exit 1; }
|
[ "$found" = "1" ] || { echo "ERROR: no review-*.png found"; exit 1; }
|
||||||
ls -la "$REPO/Screenshots"
|
echo "--- Screenshots/ ---"
|
||||||
|
ls -1 "$REPO/Screenshots"
|
||||||
|
echo "--- Screenshots/demo/ ---"
|
||||||
|
ls -1 "$REPO/Screenshots/demo"
|
||||||
@@ -201,6 +201,9 @@ try:
|
|||||||
("demo-spawn-view", unreal.Vector(-10722.5, -3500, 165), unreal.Vector(-10722.5, -1450, 700)),
|
("demo-spawn-view", unreal.Vector(-10722.5, -3500, 165), unreal.Vector(-10722.5, -1450, 700)),
|
||||||
("demo-street-level", unreal.Vector(-11000, -400, 165), unreal.Vector(-10722.5, -1450, 500)),
|
("demo-street-level", unreal.Vector(-11000, -400, 165), unreal.Vector(-10722.5, -1450, 500)),
|
||||||
("demo-crossing", unreal.Vector(-13600, -1650, 165), unreal.Vector(-12722.5, -1450, 500)),
|
("demo-crossing", unreal.Vector(-13600, -1650, 165), unreal.Vector(-12722.5, -1450, 500)),
|
||||||
|
# the two north-side background buildings (TCL, Tussaud's) seen from
|
||||||
|
# the south sidewalk, across Hollywood Blvd: their frontage and mass.
|
||||||
|
("demo-north-buildings", unreal.Vector(-22800, -1000, 400), unreal.Vector(-22800, 3000, 300)),
|
||||||
]
|
]
|
||||||
seq = spawn(unreal.GigLineShotActor, unreal.Vector(0, 0, 300), "ShotSequencer")
|
seq = spawn(unreal.GigLineShotActor, unreal.Vector(0, 0, 300), "ShotSequencer")
|
||||||
if seq:
|
if seq:
|
||||||
@@ -208,7 +211,9 @@ try:
|
|||||||
seq.set_editor_property("shot_rotations",
|
seq.set_editor_property("shot_rotations",
|
||||||
[unreal.MathLibrary.find_look_at_rotation(c[1], c[2]) for c in demo_shots])
|
[unreal.MathLibrary.find_look_at_rotation(c[1], c[2]) for c in demo_shots])
|
||||||
seq.set_editor_property("shot_names", [c[0] for c in demo_shots])
|
seq.set_editor_property("shot_names", [c[0] for c in demo_shots])
|
||||||
seq.set_editor_property("quit_when_done", False)
|
# quit after the demo shots so a dedicated DemoMap capture run
|
||||||
|
# terminates cleanly (render_screenshots.sh runs both maps).
|
||||||
|
seq.set_editor_property("quit_when_done", True)
|
||||||
saved = unreal.EditorLoadingAndSavingUtils.save_map(
|
saved = unreal.EditorLoadingAndSavingUtils.save_map(
|
||||||
unreal.EditorLevelLibrary.get_editor_world(), "/Game/Hollywood/DemoMap")
|
unreal.EditorLevelLibrary.get_editor_world(), "/Game/Hollywood/DemoMap")
|
||||||
log(f"demo map staged: {len(demo_shots)} cameras, save {saved}")
|
log(f"demo map staged: {len(demo_shots)} cameras, save {saved}")
|
||||||
|
|||||||
@@ -0,0 +1,115 @@
|
|||||||
|
# Import the two north-side background buildings (TCL Chinese Theatre, Madame
|
||||||
|
# Tussaud's) into Unreal and stage them in the demo map, across the street from
|
||||||
|
# the hero facade.
|
||||||
|
#
|
||||||
|
# Placement: these blockout meshes live in the same local frame as the site
|
||||||
|
# meshes (X east / Y north / Z up, metres, origin Hollywood x Highland), which
|
||||||
|
# are imported at the Unreal origin and land correctly via the `ue_metric_v1`
|
||||||
|
# FBX axis mapping (north -> -Y). So the buildings are spawned at Unreal
|
||||||
|
# (0,0,0) like the site meshes, not at the pivot-shifted hero facade position.
|
||||||
|
#
|
||||||
|
# UnrealEditor-Cmd <uproject> -run=pythonscript \
|
||||||
|
# -script=<repo>/Tools/ue_import_north_buildings.py -nullrhi -unattended -nopause -stdout
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
import unreal
|
||||||
|
|
||||||
|
SRC = "/tmp/gigline/north"
|
||||||
|
DEST = "/Game/Hollywood/North"
|
||||||
|
LEVEL = "/Game/Hollywood/DemoMap"
|
||||||
|
RESULT = "/tmp/gigline/north-import.txt"
|
||||||
|
lines = []
|
||||||
|
|
||||||
|
|
||||||
|
def log(msg):
|
||||||
|
lines.append(str(msg))
|
||||||
|
unreal.log(str(msg))
|
||||||
|
|
||||||
|
|
||||||
|
IMPORTS = [
|
||||||
|
("TCL_Chinese_Theatre.fbx", "SM_TCL_Chinese_Theatre"),
|
||||||
|
("Madame_Tussauds.fbx", "SM_Madame_Tussauds"),
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def import_meshes():
|
||||||
|
assets = unreal.EditorAssetLibrary.list_assets(DEST) if unreal.EditorAssetLibrary.does_directory_exist(DEST) else []
|
||||||
|
for fn, asset_name in IMPORTS:
|
||||||
|
unreal.AssetToolsHelpers.get_asset_tools().import_asset_tasks([unreal.AssetImportTask(
|
||||||
|
filename=os.path.join(SRC, fn),
|
||||||
|
destination_path=DEST,
|
||||||
|
destination_name=asset_name,
|
||||||
|
automated=True,
|
||||||
|
save=True,
|
||||||
|
replace_existing=True,
|
||||||
|
options=unreal.FbxImportUI(
|
||||||
|
import_mesh=True, import_materials=True, import_textures=False,
|
||||||
|
import_as_skeletal=False) if False else None,
|
||||||
|
)])
|
||||||
|
# FbxImportUI kwargs are unreliable across 5.8; configure explicitly below.
|
||||||
|
|
||||||
|
|
||||||
|
def stage():
|
||||||
|
if unreal.EditorAssetLibrary.does_asset_exist(LEVEL):
|
||||||
|
unreal.EditorLevelLibrary.load_level(LEVEL)
|
||||||
|
for actor in list(unreal.EditorLevelLibrary.get_all_level_actors()):
|
||||||
|
if actor.get_actor_label().startswith("North_"):
|
||||||
|
unreal.EditorLevelLibrary.destroy_actor(actor)
|
||||||
|
for asset_name, label in (("SM_TCL_Chinese_Theatre", "North_TCL_Chinese"), ("SM_Madame_Tussauds", "North_Madame_Tussauds")):
|
||||||
|
mesh = unreal.EditorAssetLibrary.load_asset(f"{DEST}/{asset_name}")
|
||||||
|
if mesh is None:
|
||||||
|
log(f"MISSING {DEST}/{asset_name}")
|
||||||
|
continue
|
||||||
|
actor = unreal.EditorLevelLibrary.spawn_actor_from_class(
|
||||||
|
unreal.StaticMeshActor, unreal.Vector(0, 0, 0))
|
||||||
|
actor.set_actor_label(label)
|
||||||
|
comp = actor.static_mesh_component
|
||||||
|
comp.set_static_mesh(mesh)
|
||||||
|
comp.set_mobility(unreal.ComponentMobility.STATIC)
|
||||||
|
# Report where the mesh actually lands in world space (site-frame → Unreal).
|
||||||
|
box = mesh.get_bounding_box()
|
||||||
|
mn, mx = box.min, box.max
|
||||||
|
log(f"{label}: mesh world-space X {mn.x:.0f}..{mx.x:.0f} Y {mn.y:.0f}..{mx.y:.0f} size "
|
||||||
|
f"{mx.x-mn.x:.0f}x{mx.y-mn.y:.0f} cm")
|
||||||
|
saved = unreal.EditorLoadingAndSavingUtils.save_map(
|
||||||
|
unreal.EditorLevelLibrary.get_editor_world(), LEVEL)
|
||||||
|
log(f"save_map {LEVEL}: {saved}")
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
for fn, asset_name in IMPORTS:
|
||||||
|
task = unreal.AssetImportTask()
|
||||||
|
task.filename = os.path.join(SRC, fn)
|
||||||
|
task.destination_path = DEST
|
||||||
|
task.destination_name = asset_name
|
||||||
|
task.automated = True
|
||||||
|
task.save = True
|
||||||
|
task.replace_existing = True
|
||||||
|
ui = unreal.FbxImportUI()
|
||||||
|
ui.import_mesh = True
|
||||||
|
ui.import_materials = True
|
||||||
|
ui.import_textures = False
|
||||||
|
ui.import_as_skeletal = False
|
||||||
|
smd = ui.static_mesh_import_data
|
||||||
|
smd.import_uniform_scale = 1.0
|
||||||
|
smd.combine_meshes = True
|
||||||
|
smd.convert_scene_unit = False
|
||||||
|
smd.force_front_x_axis = False
|
||||||
|
smd.normal_import_method = unreal.FBXNormalImportMethod.FBXNIM_IMPORT_NORMALS
|
||||||
|
task.options = ui
|
||||||
|
unreal.AssetToolsHelpers.get_asset_tools().import_asset_tasks([task])
|
||||||
|
log(f"imported {asset_name}")
|
||||||
|
unreal.EditorLoadingAndSavingUtils.save_dirty_packages(True, True)
|
||||||
|
stage()
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
main()
|
||||||
|
except Exception as exc: # noqa
|
||||||
|
import traceback
|
||||||
|
log(f"FAILED: {type(exc).__name__}: {exc}")
|
||||||
|
log(traceback.format_exc())
|
||||||
|
|
||||||
|
with open(RESULT, "w") as f:
|
||||||
|
f.write("\n".join(lines) + "\n")
|
||||||
Reference in new issue
Block a user