feat(facades): 0.1.5 — hero detail, scene audit, material orphaning fixed (#32)
Merged PR #32: 0.1.5 — hero detail, scene audit, material orphaning fixed Co-authored-by: Zwitschi <zwitschi82@gmail.com>
This commit was merged in pull request #32.
This commit is contained in:
1 parent
743a290ac9
commit
73aca9db80
50 files changed
+1326
-88
No files matched your search
@@ -19,14 +19,19 @@ import unreal
|
||||
|
||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||
import ue_common # noqa: E402
|
||||
import ue_placement # noqa: E402
|
||||
|
||||
FBX = "/tmp/gigline/hero-facade.fbx"
|
||||
DEST = "/Game/Hollywood/ElCapitan"
|
||||
ACTOR_LABEL = "Hero_Facade"
|
||||
ACTOR_LABEL = ue_placement.HERO_ACTOR
|
||||
LEVEL = "/Game/Hollywood/DemoMap"
|
||||
|
||||
# Unreal centimetres: south-east corner of the façade, on the building line.
|
||||
PLACEMENT_CM = (-12024.5, -1450.0, 0.0)
|
||||
# Placement lives in Tools/ue_placement.py. It used to be a literal here, and it
|
||||
# drifted from ue_build_demo_map.py: this file kept the pre-0.1.0 position
|
||||
# (-12024.5, -1450) while the builder staged (-13336, 1307), so running the importer
|
||||
# on its own moved the hero 13 m east and onto the north side of the boulevard.
|
||||
PLACEMENT_CM = ue_placement.HERO_LOCATION_CM
|
||||
|
||||
RESULT = "/tmp/gigline/hero-facade-import.txt"
|
||||
lines = []
|
||||
@@ -118,6 +123,17 @@ def measure_and_place():
|
||||
comp.set_static_mesh(asset)
|
||||
comp.set_mobility(unreal.ComponentMobility.STATIC)
|
||||
log(f"placed {ACTOR_LABEL} at {PLACEMENT_CM} (cm) on {LEVEL}")
|
||||
|
||||
# Prove it landed on its verified footprint, not merely that it spawned.
|
||||
box = asset.get_bounding_box() if asset else None
|
||||
if box:
|
||||
lo = box.min.x + PLACEMENT_CM[0]
|
||||
hi = box.max.x + PLACEMENT_CM[0]
|
||||
problem = ue_placement.describe_span_failure("hero", lo, hi)
|
||||
if problem:
|
||||
log(f"PLACEMENT ERROR: {problem}")
|
||||
else:
|
||||
log(f"span ok: X {lo:.0f}..{hi:.0f}")
|
||||
_make_map_writable(LEVEL)
|
||||
saved = unreal.EditorLoadingAndSavingUtils.save_map(
|
||||
unreal.EditorLevelLibrary.get_editor_world(), LEVEL)
|
||||
|
||||
Reference in new issue
Block a user