User guide

52
Generated Scene Graph Structure
Internally, Scene Graph Generator plug-ins use contexts to create new locations in the scene graph. A scene graph
location may contain child locations, have sibling locations and hold any number of attributes.
The main context created by an SGG plug-in is called the root context. This context represents the first location of
the portion of scene graph that is generated by the plug-in. Each context in an SGG plug-in can provide a single first
child context - a context one level below the context that created it - and a single next sibling context - a context at
the same level as its creating context - both of which are optional.
Katana traverses through the user-defined contexts, starting from the root of the SGG plug-in, which in turn
populates the scene graph with the desired locations, their attributes and values. By subsequently providing first
child and next sibling contexts from contexts in an SGG plug-in, arbitrarily nested scene graph structures can be
created.
The following image shows locations created by a simple CubeMaker SGG example plug-in, in the Scene Graph tab.
Note how cube_0 is the first child of the scenegraphGenerator location, cube_1 is the second child, and cube_3 is the
third. All cube_# locations are of type polymesh and contain attributes that define geometry of polygonal cubes.
TIP: An SGG plug-in can be used to create scenegraphGenerator locations when its code is executed,
thereby allowing for recursion. This can be used to embed assets in other assets, or to create fractal
structures, for example. The ScenegraphXML SGG plug-in supports recursion in this way.
8 SCENE GRAPH GENERATOR PLUG-INS | RUNNING AN SGG PLUG-IN