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
- Hayba is installed and your agent is connected. See Getting started.
- A level with a floor is open, such as the default open world template.
- Review each external edit is off. Spawning actors cannot be approved by the exact review on this version. Moving and deleting existing actors can; see What can be approved.
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
actor_listlists every actor with label, class and transform.placement_validatechecks whether an actor would overlap anything at a spot, without spawning it.actor_spawn_from_assetplaces each mesh by asset path, withsnap_to_floor, and reads back the final transform.actor_transformmoves, rotates or scales an actor afterwards.editor_focus_actorframes an actor from its bounds without tilting the horizon.editor_capture_viewportreturns the viewport as an image. Withwait_for_shadersit waits for shader compiles first.
Things worth knowing:
- To spawn by class rather than asset, such as a light or a volume, the agent uses
actor_spawn. For many actors at once,actor_batch_spawnuses one call and one undo entry. placement_validateanswers about overlap only. It does not say whether the spot makes sense or is on the navmesh.- Rotation order is not the same in every tool:
actor_spawn_from_assettakes[roll, pitch, yaw], and the reference lists each tool's format. To aim the camera at a point,editor_set_cameratakeslook_at, which avoids computing angles. - A capture taken while shaders compile shows grey placeholder materials. Use
wait_for_shaders, orwait_for_idlebefore the capture. - For a file on disk at a fixed resolution,
render_camerarenders a camera view and checks that the file was written.
Check the result
- Look at the capture the agent returns.
- Each placement is one entry in Edit, Undo History, named
Hayba: <command>. Ctrl+Z removes them one at a time. - The level is not saved until you or the agent save it.