Skip to content

Place actors and capture the viewport

Have an agent read what is in the level, check that a spot is clear, place and move actors, frame the camera and return a picture of the viewport.

Before you start

Prompt

Prompt
List the actors in the level. Then place three cubes from /Engine/BasicShapes/Cube in a row 300 units apart, starting at 0, 0, 100, snapped to the floor, labelled Crate_1 to Crate_3. Check each spot is clear before placing it. Frame Crate_2 in the viewport, wait for shaders, and show me a capture.

What the agent does

  1. actor_list lists every actor with label, class and transform.
  2. placement_validate checks whether an actor would overlap anything at a spot, without spawning it.
  3. actor_spawn_from_asset places each mesh by asset path, with snap_to_floor, and reads back the final transform.
  4. actor_transform moves, rotates or scales an actor afterwards.
  5. editor_focus_actor frames an actor from its bounds without tilting the horizon.
  6. editor_capture_viewport returns the viewport as an image. With wait_for_shaders it waits for shader compiles first.

Things worth knowing:

Check the result