review: put the character on the floor, split the cubes, commit the shots
The review floor was a 5 cm slab centred 50 cm down, so the character floated 1.8 m above it. The floor is now 90 m x 90 m x 10 cm with its top face at Z 0 and the character measures Z 0..83 cm - feet on the plane. Two cubes only: A on the ground as the contact/scale reference, B held at 2 m so its cast shadow separates from the body for comparison. The scale-cubes camera was still aimed at the old three-cube row and now looks at both from the south. Screenshots are committed per the owner's instruction, and .gitignore no longer excludes them.
This commit is contained in:
1 parent
3be37c76a2
commit
0383eabc8e
11 files changed
+75
-23
No files matched your search
@@ -59,8 +59,10 @@ try:
|
||||
|
||||
floor_mesh = unreal.EditorAssetLibrary.load_asset("/Game/Test/ScaleTest/ScaleTest_A")
|
||||
if floor_mesh and floor_mat:
|
||||
floor = spawn(unreal.StaticMeshActor, unreal.Vector(450, 450, -50.0), "ReviewFloor",
|
||||
scale=(45.0, 45.0, 0.1))
|
||||
# 1 m reference cube scaled to 90 m x 90 m x 0.1 m, top face at Z 0. The
|
||||
# scale is applied on the actor, so Z is -5 cm (+/- 5 cm around centre).
|
||||
floor = spawn(unreal.StaticMeshActor, unreal.Vector(0, 450, -5.0), "ReviewFloor",
|
||||
scale=(90.0, 90.0, 0.1))
|
||||
if floor:
|
||||
floor.static_mesh_component.set_static_mesh(floor_mesh)
|
||||
floor.static_mesh_component.set_material(0, floor_mat)
|
||||
@@ -81,18 +83,38 @@ try:
|
||||
ch = spawn(unreal.SkeletalMeshActor, unreal.Vector(0, 0, 0), "ReviewCharacter",
|
||||
rot=unreal.Rotator(pitch=0.0, yaw=180.0, roll=0.0))
|
||||
if ch:
|
||||
ch.skeletal_mesh_component.set_skinned_asset_and_update(char_mesh)
|
||||
comp = ch.skeletal_mesh_component
|
||||
comp.set_skinned_asset_and_update(char_mesh)
|
||||
# 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)
|
||||
mn, mx = (None, None)
|
||||
try:
|
||||
_origin, _box = ch.get_actor_bounds(False)
|
||||
log(f"staged: MPFB character at origin, bounds z {_box.z:.1f} cm")
|
||||
except Exception as exc: # noqa: BLE001
|
||||
log(f"character bounds unavailable: {exc!r}")
|
||||
log("staged: MPFB character at origin, facing -Y")
|
||||
else:
|
||||
log("MISSING: /Game/Test/Character/character")
|
||||
|
||||
for name, x in (("ScaleTest_A", -400.0), ("ScaleTest_B", 0.0), ("ScaleTest_C", 400.0)):
|
||||
# Two cubes only, on purpose: one resting on the floor gives the ground-contact
|
||||
# and scale reference, one held at 2 m gives a clean cast shadow to compare
|
||||
# against. Their positions are chosen so both are in the overview frame and
|
||||
# neither overlaps the character.
|
||||
cube_specs = (
|
||||
("ScaleTest_A", -250.0, 600.0, 50.0, "on the ground: base at Z 0"),
|
||||
("ScaleTest_B", 250.0, 600.0, 250.0, "floating at 2 m: casts a separation shadow"),
|
||||
)
|
||||
for name, x, y, z, why in cube_specs:
|
||||
m = unreal.EditorAssetLibrary.load_asset(f"/Game/Test/ScaleTest/{name}")
|
||||
if m:
|
||||
c = spawn(unreal.StaticMeshActor, unreal.Vector(x, 600.0, 50.0), f"Cube_{name}")
|
||||
c = spawn(unreal.StaticMeshActor, unreal.Vector(x, y, z), f"Cube_{name}")
|
||||
if c:
|
||||
c.static_mesh_component.set_static_mesh(m)
|
||||
log(f"staged: {name} at ({x}, 600, 50)")
|
||||
log(f"staged: {name} at ({x}, {y}, {z}) - {why}")
|
||||
|
||||
# Hero facade, if the import has run: two views a reviewer needs — straight on
|
||||
# from the north sidewalk, and the oblique street view from further west.
|
||||
@@ -114,9 +136,9 @@ try:
|
||||
shots = spawn(unreal.GigLineShotActor, unreal.Vector(0, 0, 300), "ShotSequencer")
|
||||
if shots:
|
||||
shots.set_editor_property("shot_locations", [
|
||||
unreal.Vector(900, -1100, 500),
|
||||
unreal.Vector(700, -900, 620),
|
||||
unreal.Vector(200, -300, 160),
|
||||
unreal.Vector(200, 100, 200),
|
||||
unreal.Vector(0, -900, 200),
|
||||
# first-person eye height, just south-east of the character: this is the
|
||||
# view a player has at spawn, capsule and camera stack in frame
|
||||
unreal.Vector(120, -260, 165),
|
||||
@@ -129,11 +151,11 @@ try:
|
||||
])
|
||||
shots.set_editor_property("shot_rotations", [
|
||||
unreal.MathLibrary.find_look_at_rotation(
|
||||
unreal.Vector(900, -1100, 500), unreal.Vector(100, 200, 80)),
|
||||
unreal.Vector(700, -900, 620), unreal.Vector(0, 300, 80)),
|
||||
unreal.MathLibrary.find_look_at_rotation(
|
||||
unreal.Vector(200, -300, 160), unreal.Vector(0, 0, 85)),
|
||||
unreal.MathLibrary.find_look_at_rotation(
|
||||
unreal.Vector(200, 100, 200), unreal.Vector(0, 600, 50)),
|
||||
unreal.Vector(0, -900, 200), unreal.Vector(0, 600, 80)),
|
||||
unreal.MathLibrary.find_look_at_rotation(
|
||||
unreal.Vector(120, -260, 165), unreal.Vector(-200, 600, 90)),
|
||||
unreal.MathLibrary.find_look_at_rotation(
|
||||
|
||||
Reference in new issue
Block a user