Simulation Cache Layout File (.gscl)

The Simulation Cache Layout File (.gscl) is a JSON file which stores a layout graph (and its children group layout graphs). In python, the file translates into a dict(). It is manipulated via the Golaem Simulation Cache Layout Tool.

Python API is also available for batch editing.

Here is an example graph:

And its group subgraph :

 

And finally the corresponding .gscl file:

{
  "connections": [
    [ 3, 4], 
    [2, 3], 
    [0, 1]
  ], 
  "layoutFileVersion": 1, 
  "nextNodeId": 5, 
  "licenseHashKey": 0, 
  "currentFilePath": "C:/temp/selectorChar/export/selectorChar2.gscl", 
  "groups": [], 
  "nodes": [
    {
      "name": "Rotate", 
      "type_name": "Rotate", 
      "active": 1, 
      "attributes": [
        {
          "frames": [], 
          "values": [
            [
              [
                0.0, 
                90.0, 
                0.0
              ]
            ]
          ], 
          "type": 6, 
          "flags": 16, 
          "name": "rotate"
        }, 
        {
          "frames": [], 
          "values": [
            [
              [
                0.0, 
                0.0, 
                0.0
              ]
            ]
          ], 
          "type": 6, 
          "flags": 16, 
          "name": "pivot"
        }
      ], 
      "type": 1, 
      "ID": 4, 
      "GUI_pos": [
        1514.1723065776293, 
        142.0
      ]
    }, 
    {
      "active": 1, 
      "entities": "char(0)", 
      "ID": 3, 
      "name": "Selector", 
      "GUI_pos": [
        1294.1723065776293, 
        122.0
      ]
    }, 
    {
      "name": "Group", 
      "type_name": "Group", 
      "active": 1, 
      "attributes": [
        {
          "frames": [], 
          "values": [
            [
              1
            ]
          ], 
          "type": 2, 
          "name": "rootNodeId"
        }, 
        {
          "frames": [], 
          "values": [
            [
              0, 
              1
            ]
          ], 
          "type": 2, 
          "name": "childrenNodeIds", 
          "flags": 1
        }
      ], 
      "type": 22, 
      "ID": 2, 
      "GUI_pos": [
        1073.0, 
        83.0
      ]
    }, 
    {
      "active": 1, 
      "entities": "1001,6001,9001", 
      "GUI_pos": [
        830.0, 
        122.0
      ], 
      "name": "Selector", 
      "ID": 0
    }, 
    {
      "name": "Translate", 
      "type_name": "Translate", 
      "active": 1, 
      "attributes": [
        {
          "frames": [], 
          "type": 6, 
          "values": [
            [
              [
                0.0, 
                0.0, 
                5.0
              ]
            ]
          ], 
          "flags": 16, 
          "name": "translate"
        }
      ], 
      "type": 3, 
      "ID": 1, 
      "GUI_pos": [
        1050.0, 
        122.0
      ]
    }
  ], 
  "rootTransformId": 4
}

File description

Single value file entries

layoutFileVersion The version number of this file (int)
nextNodeId keep track of next available node Id for node creation (recomputed at each file loading, as max node ID + 1) (int)
licenseHashKey Internal use (int)
currentFilePath Complete path of the file the last time it has been saved (used to avoid reloading an existing file when editing) (string)
groups Unused (groups are stored as common nodes) (empty list)
rootTransformId The node Id of root node (int)

Connections entry

Connections entry value is a list of dual value lists, indicating a connection from the first node Id to the second node Id. It holds all connections, from the main graph and all its groups sub-graphs. However, defining connections between nodes from different graphs together is forbidden, and its result is undefined : it makes no sense to connect nodes from different graphs.

Nodes entry

Nodes entry value is a list of objects. Each object can either be a selector, or an operator. Selectors and operators store their elements as a python dictionary (dict).

Common selector/operator dictionary entries

Here is a list of the dictionary entries present in both by the selectors and operators : 

active 1 if the node is active, 0 if it must be ignored. (0 or 1)
GUI_pos values indicating X & Y position of the node, in the graphical scene (list of 2 integers)
name the name of the node, by default "selector" (string)
ID Unique node identifier into this layout file (int)
Selector specific dictionary entries
entities The entities selection expression (string)
Operator specific dictionary entries

All possible types of operators are defined in a specific JSON file, packed in [golaemInstallationFolder]/scripts/glm/golaem_layoutNodes_definition.json. 

type_name the string type of the node
type the integer type of the node
attributes

Attributes itself is a python dictionary. Its entries depend of the node type.

Each attribute have these entries :

  • frames : list of int holding frames, empty if not using keyframes
  • type : 1 is char (strings), 2 is int, 3 is unsigned int, 4 is int64 (entityIds), 5 is float, 6 is vec3, 7 is vec4
  • values : holds a list of list of values per keyframe. If no keyframe, a single value array is used. Inside this keyframe array, an array for values, and finally a potential array for each value when using vec3 or vec4.
    • a single, non keyframed element value looks like [[ 1 ]]
    • a single vec3, non keyframed looks like [[ [0,1,2] ]]
    • a vec3 array, non keyframed, looks like [[ [0,1,2] [3,4,5] ]]
    • an integer/float with 3 key frame looks like [ [0.7] [1.5] [2.9] ]
    • a vec3 array, with 2 keyframes, looks like [ [[0,1,2]] [[3,4,5]] ]
  • flags : for internal use only
  • name : the name of this attribute

Groups

While the user interface displays several graphs for the main graph & its children groups, the layout file only holds a single list of nodes. When group nodes are met in the list, their children are dispatched in the different graphs at loading. Groups attributes include its children node IDs list, and the node meant to be the root of this group (a group without a valid root defined is a "pass thru" node).