DAZ Studio Scene Hierarchy

The Scene
The DzScene class is at the heart of the DAZ Studio SDK. There is only one instance of DzScene that is active in the DAZ Studio application, the global variable Scene provides access to the scene object from anywhere. The scene maintains a list of all the items loaded and is responsible for drawing and rendering them.

Nodes
The basic building block of a scene is the DzNode class. Nodes are objects that simply have a position in the scene, and optionally, have associated geometry that is drawn. Every item that participates in the scene is a DzNode - i.e. Lights, Cameras, Props, Figures, etc are all represented by DzNode objects.

There are a few specialized node types in the DAZ Studio SDK:

DzCamera - The base class for all camera objects in the scene.
DzLight - The base class for all light objects in the scene.
DzSkeleton - Serves as the root or 'Body' node of a figure.
DzBone - Represents a single part or 'Bone' in a figure.

The scene keeps a list of all the nodes in the scene. It also keeps three lists of specific node types for convenience:

Skeleton list - A list of all figures (skeletons) in the scene.
Camera list - A list of all cameras in the scene.
Light list - A list of all lights in the scene.

Diagram 1 shows the relationship of all the items in the scene when the scene contains two props (a ball and a box), two lights, and a camera:

inline_dotgraph_4.dot

Diagram 2 shows a similar scene, only with a simple figure in place of the two props:

inline_dotgraph_5.dot

Node Hierarchy
Nodes participate in a hierarchy. Each node can have a parent and can have one or more child nodes. Nodes with parents move in the space of that parent, i.e. all their transforms are relative to the parent node, if the parent node is moved, then all its children follow. Nodes without a parent are called 'Root' nodes, and can be thought of as children of the world, since all their transforms are in world space.

The simple figure from the second scene is a good example of a node hierarchy. In this case, 'MyFigure_#' is a root node which has one child: 'Hip'. 'Hip' in turn has three children: 'Abdomen', 'Left Leg', and 'Right Leg'. 'Abdomen' has one child: 'Chest'. 'Chest' also has three children: 'Head', 'Left Arm' and 'Right Arm'.

Let's say that in the scene, the user has seated the figure, parented it to a chair, parented a crown prop to the figure's head, and parented a sceptre prop to the figure's right arm. The node hierarchy would now look like this:

inline_dotgraph_6.dot

Generated on Thu Sep 24 12:21:09 2009

Copyright © 2002 - 2009 DAZ 3D, Inc.