Skip to content

Communication between the CLI and OGrEE 3D

Cédric Vautrain edited this page Jan 17, 2022 · 16 revisions

OGrEE-3D is listening to the TCP port 5500.

All data are given with a simple json structure:

{
  "type" : "keyword",
  "data" : "serialized corresponding data structure"
}

Load a template

{
  "type" : "load template",
  "data" : "JSON of the template (in API format)"
}

Hierarchy commands

Select an object

{
  "type" : "select",
  "data" : "id of the object to select"
}

Delete an object

{
  "type" : "delete",
  "data" : "id of the object to delete"
}

Focus an object

{
  "type" : "focus",
  "data" : "id of the object to focus"
}

Objects manipulation

Create an object

{
  "type" : "create",
  "data" : "JSON of the created object (in API format)"
}

Modify an object

{
  "type" : "modify",
  "data" : "JSON of the created object (in API format)"
}

Manipulate UI

{
  "type" : "ui",
  "data" : Serialized UI instruction
}

Delay

{
  "command" : "delay",
  "data" : "time" 
}

Infos panel

{
  "command" : "infos",
  "data" : "true|false" 
}

Debug panel

{
  "command" : "debug",
  "data" : "true|false" 
}

Highlight an object

{
  "command" : "highlight",
  "data" : "id of the object to highlight" 
}

Manipulate camera

{
  "type" : "camera",
  "data" : Serialized camera instruction
}

Move

{
  "command" : "move",
  "position" : "{"x":posX, "y":posY, "z":posZ}",
  "rotation" : "{"x":rotX, "y":rotY}"
}

Translate

{
  "command" : "translate",
  "position" : "{"x":posX, "y":posY, "z":posZ}",
  "rotation" : "{"x":rotX, "y":rotY}"
}

Wait

{
  "command" : "wait",
  "position" : null,
  "rotation" : "{"x":999, "y":time}"
}
Clone this wiki locally