editor.viewport.getCamera
Returns the current viewport camera position, rotation, view mode, and realtime status.
No parameters.
Returns:
| Name | Type | Description |
|---|---|---|
position | object | {x, y, z} camera location |
rotation | object | {pitch, yaw, roll} camera rotation |
view_mode_index | number | Numeric EViewModeIndex |
view_mode | string | Human-readable name (e.g. "Lit", "Wireframe") |
is_realtime | bool | Whether viewport is in realtime mode |
is_perspective | bool | Whether camera is in perspective mode |
Example Request:
{ "jsonrpc": "2.0", "id": 1, "method": "editor.viewport.getCamera" } Example Response:
{
"jsonrpc": "2.0", "id": 1,
"result": {
"position": { "x": 0.0, "y": 0.0, "z": 200.0 },
"rotation": { "pitch": -30.0, "yaw": 0.0, "roll": 0.0 },
"view_mode_index": 0, "view_mode": "Lit",
"is_realtime": true, "is_perspective": true
}
} editor.viewport.setCamera
Sets the viewport camera position and/or rotation.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
position | object | No* | {x, y, z} new camera position |
rotation | object | No* | {pitch, yaw, roll} new camera rotation |
*At least one of position or rotation must be provided.
Returns:
| Name | Type | Description |
|---|---|---|
success | bool | Whether camera was updated |
position_set | bool | Whether position was changed |
rotation_set | bool | Whether rotation was changed |
Example Request:
{
"jsonrpc": "2.0", "id": 1, "method": "editor.viewport.setCamera",
"params": { "position": { "x": 500, "y": 0, "z": 300 }, "rotation": { "pitch": -45, "yaw": 0, "roll": 0 } }
} editor.viewport.setRenderMode
Changes the viewport render/view mode.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
mode | string | No* | One of: wireframe, unlit, lit, detail_lighting, lighting_only, light_complexity, shader_complexity |
index | number | No* | Numeric EViewModeIndex value |
*One of mode or index must be provided.
Returns:
| Name | Type | Description |
|---|---|---|
success | bool | Whether mode was changed |
mode | string | Active view mode name |
mode_index | number | Active view mode index |
Example Request:
{ "jsonrpc": "2.0", "id": 1, "method": "editor.viewport.setRenderMode", "params": { "mode": "wireframe" } } editor.viewport.setRealtime
Enables or disables realtime rendering in the viewport.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
enabled | bool | Yes | Whether realtime mode should be on |
Returns:
| Name | Type | Description |
|---|---|---|
success | bool | Whether setting was applied |
is_realtime | bool | New realtime state |
Example Request:
{ "jsonrpc": "2.0", "id": 1, "method": "editor.viewport.setRealtime", "params": { "enabled": true } } editor.viewport.focusOnActor
Focuses the viewport camera on a specific actor.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
actor_path | string | Yes | Full path name of the actor to focus on |
instant | bool | No | Teleport camera instantly vs. animated (default false) |
Returns:
| Name | Type | Description |
|---|---|---|
success | bool | Whether focus succeeded |
actor_path | string | Actor path |
actor_name | string | Actor display label |
Example Request:
{ "jsonrpc": "2.0", "id": 1, "method": "editor.viewport.focusOnActor", "params": { "actor_path": "/Game/Maps/Level.Level:PersistentLevel.Cube" } }