fix(review): stage objects by their measured bounds, and aim the vehicle cameras at the car

The review notes named the same class of problem in six rows: things sitting a little too low or too
high in the floor. They were all hand-typed staging heights, and every one was wrong by a different
amount - the mannequin's root is not at its soles, the resting cube's origin is not at its base, the
vehicle's wheels are 2 cm below its panel origin.

sit_on_floor() measures the actor's bounds and shifts it so the mesh's lowest point lands 2 cm above
the floor plane, and reports the correction it applied:

  MPFB character    +2.0 cm
  ScaleTest_A      -48.0 cm   (it was floating)
  vehicle wheels    +2.0 cm

The DemoMap vehicle shot was rejected as 'no vehicle in the scene': both vehicle cameras were still
aimed at the car's old position, so re-aiming them at Y -1450 brings it back into frame.

Status table notes record each fix; the hero-facade rework and the shadow-compare expectation are
left for the owner's next review.
This commit is contained in:
zwitschi committed 2026-11-09 19:39:04 +01:00
1 parent 1b4b46e957
commit fb5488c1df
108 files changed
+187 -159

No files matched your search

+32 -4
View File
@@ -49,6 +49,25 @@ def ensure_writable(path):
pass
def sit_on_floor(actor, floor_z=2.0):
"""Shift an actor so the mesh's lowest point lands on `floor_z`.
Staging heights were hand-typed and every one of them was a little wrong - the mannequin's root
is not at the soles, the scale cube's origin is not at its base - which is what the review keeps
catching. Measuring the bounds and correcting is the only version that stays right when an
asset changes. The default 2 cm keeps soles and tyres on TOP of the floor plane rather than
exactly level with it, where they read as sunk.
"""
try:
origin, box = actor.get_actor_bounds(False)
except Exception: # noqa: BLE001
return None
lowest = origin.z - box.z
loc = actor.get_actor_location()
actor.set_actor_location(unreal.Vector(loc.x, loc.y, loc.z + (floor_z - lowest)), False, False)
return floor_z - lowest
def spawn(cls, loc, label=None, scale=None, rot=None):
a = unreal.EditorLevelLibrary.spawn_actor_from_class(cls, loc)
if a is None:
@@ -131,8 +150,9 @@ try:
# Root at the soles, not the world origin: the composes put feet on the
# floor's top face (Z = 0). If the skeletal root is not at the soles the
# character would float or sink, so report the bounds for the review.
if hasattr(ch, "set_actor_location"):
ch.set_actor_location(unreal.Vector(0, 0, 0), False, False)
shift = sit_on_floor(ch)
if shift is not None:
log(f"staged: MPFB character sat on the floor (shift {shift:+.1f} cm)")
mn, mx = (None, None)
try:
_origin, _box = ch.get_actor_bounds(False)
@@ -157,6 +177,11 @@ try:
c = spawn(unreal.StaticMeshActor, unreal.Vector(x, y, z), f"Cube_{name}")
if c:
c.static_mesh_component.set_static_mesh(m)
if name == "ScaleTest_A":
# The resting cube is the ground-contact reference, so its base must be
# exactly on the floor rather than wherever its origin happens to be.
shift = sit_on_floor(c)
log(f"staged: {name} sat on the floor (shift {shift:+.1f} cm)")
log(f"staged: {name} at ({x}, {y}, {z}) - {why}")
# Hero facade, if the import has run: two views a reviewer needs — straight on
@@ -210,6 +235,9 @@ try:
if piece:
piece.static_mesh_component.set_static_mesh(mesh)
piece.static_mesh_component.set_mobility(unreal.ComponentMobility.STATIC)
if mesh_name == "SM_Vehicle_Wheels":
shift = sit_on_floor(piece)
log(f"staged: vehicle wheels sat on the floor (shift {shift:+.1f} cm)")
if mesh_name == "SM_Vehicle_Body":
paint = unreal.EditorAssetLibrary.load_asset(
"/Game/Hollywood/Vehicle/M_Vehicle_HatchPaint")
@@ -322,12 +350,12 @@ try:
# The sedan, staged on the carriageway at (-12950, -900). Three-quarter front
# view from the road so both the body and the wheels are visible: a side-on
# or rear view hides the wheel stances that the build is judged on.
("demo-vehicle", unreal.Vector(-12560, -1560, 560), unreal.Vector(-12950, -900, 420), 45.0),
("demo-vehicle", unreal.Vector(-12560, -2150, 420), unreal.Vector(-12950, -1450, 220), 45.0),
# Ground-level angles on the contact points. The wide shots cannot settle whether
# the feet and wheels touch the surface - that question needs the camera near the
# ground, looking along it, where a gap is a visible sliver of surface.
("demo-feet", unreal.Vector(-13140, -1280, 200), unreal.Vector(-13336, -1450, 170), 40.0),
("demo-wheel", unreal.Vector(-12380, -580, 430), unreal.Vector(-12950, -900, 200), 55.0),
("demo-wheel", unreal.Vector(-12380, -1050, 300), unreal.Vector(-12950, -1450, 175), 55.0),
("demo-spawn-view", unreal.Vector(-13336, -3100, 620), unreal.Vector(-13336, 1300, 620), 48.0),
# Street level, from the north sidewalk: the old camera sat at Y -400,
# inside the facade body (which spans Y -1457..-200), so it looked at