editor.pie

Play-in-Editor (PIE) and Simulate-in-Editor (SIE) session control

← API Reference

editor.pie.play

Start a Play-in-Editor or Simulate-in-Editor session.

Parameters:

Name Type Required Description
modestringNoSession mode: "pie" (default) or "simulate"/"sie"
start_locationobjectNoOverride start location: {"x": 0, "y": 0, "z": 0}
start_rotationobjectNoOverride start rotation: {"pitch": 0, "yaw": 0, "roll": 0}

Returns:

Name Type Description
successbooleanWhether the play request was queued
modestring"pie" or "simulate"

Example Request:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "editor.pie.play",
  "params": {}
}

Example Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "success": true,
    "mode": "pie"
  }
}

Example Request (Simulate with custom start):

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "editor.pie.play",
  "params": {
    "mode": "simulate",
    "start_location": {"x": 100, "y": 200, "z": 300}
  }
}

editor.pie.stop

Stop the current Play-in-Editor or Simulate-in-Editor session.

No parameters.

Returns:

Name Type Description
successbooleanWhether the stop request was issued

Example Request:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "editor.pie.stop",
  "params": {}
}

Example Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "success": true
  }
}

editor.pie.getState

Query the current PIE/SIE session state.

No parameters.

Returns:

Name Type Description
statestring"idle", "queued", or "playing"
is_playingbooleanWhether a PIE/SIE session is active
is_queuedbooleanWhether a session is queued to start next tick
is_simulatingbooleanWhether we are in Simulate-in-Editor mode
is_pausedboolean(only when playing) Whether the session is paused
instance_countnumber(only when playing) Number of PIE instances
elapsed_secondsnumber(only when playing) Seconds since session started
modestring(only when playing) "pie" or "simulate"

Example Request:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "editor.pie.getState",
  "params": {}
}

Example Response (idle):

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "state": "idle",
    "is_playing": false,
    "is_queued": false,
    "is_simulating": false
  }
}

Example Response (playing):

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "state": "playing",
    "is_playing": true,
    "is_queued": false,
    "is_simulating": false,
    "is_paused": false,
    "instance_count": 1,
    "elapsed_seconds": 12.5,
    "mode": "pie"
  }
}

editor.pie.pause

Pause all PIE worlds.

No parameters.

Returns:

Name Type Description
successbooleanWhether the pause was applied
is_pausedbooleanAlways true on success

Example Request:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "editor.pie.pause",
  "params": {}
}

Example Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "success": true,
    "is_paused": true
  }
}

editor.pie.resume

Resume all paused PIE worlds.

No parameters.

Returns:

Name Type Description
successbooleanWhether the resume was applied
is_pausedbooleanAlways false on success

Example Request:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "editor.pie.resume",
  "params": {}
}

Example Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "success": true,
    "is_paused": false
  }
}