Working with the Softimage Scene Graph
The Softimage Scene Graph consists of a relationship between data nodes (such as a 3DObject, transform, primitive, cluster, etc.) and the operators that manipulate them (such as generators, deformers, expressions, constraints, etc.).
What you see in the Scene Explorer is a representation of the data nodes nesting hierarchy. Most scene elements have their own interface, such as X3DObject for 3D scene objects, Camera for cameras, Model for models, and so on. Likewise, the Primitive and Geometry interfaces are available via their 3D object to provide low-level access to the subcomponent elements.
All property sets use either the generic Property interface or specialized ones for frequently-accessed information, such as Kinematics, Constraint, Shader, or Material. Parameters are usually represented by the Parameter interface (although there are also specialized interfaces such as ProxyParameter).
You can use one of these methods to find children of the scene root:
|
How to find children |
Object Model |
C++ API |
|
Look for an object using its name, type or family. Returns the first one found. |
||
|
Look for a collection of objects using name, type or family. Returns all objects that match the search criteria. |
||
|
Use the Find methods (available on most collectons in the object model and on the CRefArray class in the C++ API) to find the first object matching the type specified. |
X3DObjectCollection.Find, etc. |
|
|
Use the Filter methods to get the subset of the collection that matches the filter criterion. You can use the object’s type, its family or a full or partial path (using wildcards). |
SIObject.NestedObjects Property (Object Model) and SIObject::GetNestedObjects Function (C++ API)
The SIObject.NestedObjects object model property and the SIObject::GetNestedObjects function return elements below the current object (ie., children). The nested objects returned by the function are scene objects such as Property, Parameter, X3DObject, etc.
![]()
|
To return elements above the current object (ie., parents), you can use SIObject.Parent or ProjectItem.Owners with the object model and SIObject::GetParent or ProjectItem::GetOwners with the C++ API. |
EnumElements (Scripting Command)
The EnumElements command returns a list of elements either above or below the specified object. Normally, when you use one of the FindChild methods on a scene object, it only considers other scene objects underneath. However, EnumElements makes it much easier to crawl up and down the hierarchy because it treats properties and parameters like children.
The Softimage SDK offers many specialized API methods to traverse through relationships of the scene graph. For example:
• Parameter.Source (Parameter::GetSource in the C++ API) returns the piece of data attached to (driving) a parameter, such as an FCurve, Shader, Expression or Operator.
• The ConstructionHistory allows you to browse the operator stack.
• In the object model, you can use the SceneItem.LocalProperties (SceneItem::GetLocalProperties in the C++ API) to get the local versions of shared properties (material, for example).
• Geometry.Clusters (Geometry::GetClusters in the C++ API) provides the access to any cluster properties on the object.
etc.
Finding Elements using the Full Path
If you know the full path of an object you can get a pointer to it using the Dictionary.GetObject method. Alternatively, if you wanted to use scripting commands, you could use the GetValue command with the full path specified. Both strategies return an object pointer.
The equivalent C++ function to the Dictionary.GetObject is the CRef::Set function which makes it very easy to turn the full name (SIObject::GetFullName of an object into its equivalent C++ object.
CRef refRateParam; refRateParam.Set( L"PlayControl.Rate" ); app.LogMessage( Parameter(refRateParam).GetValue().GetAsText() );
In this case we are reading the value of a Parameter, so notice how a temporary Parameter object is used to give access to the Parameter::GetValue method.
Autodesk Softimage v7.5