Generically Accessing Parenting
Information
You will often hear of dependency graph (DG)
and directed acyclic graph (DAG) nodes
when dealing with Maya. simply put, every node in Maya is a DG
node. It simply means that they can recieve input and output connections
from other nodes and attributes.
A DAG node on the other hand, is something that physically exists
within the scene. This basically breaks down into two catagories,
shapes and transforms. For example, meshes, locators and cameras
are all considered to be shapes, since they are transformed
into position. A lambert shader node however is not a DAG node,
since it is only a surface property applied to a DAG shape.
With any scene graph it is vital that we know how to determine
the transform hierarchy. Within maya this is fairly trivial to
achieve using the MFnDagNode function set.
In maya you can query both the number of children, and the number
of parents on each node. It may seem odd that there may be multiple
parents, but this is merely a way to support instancing.
Between this function and the previous one, you should have a
pretty good idea of how to read back a basic scene hierarchy from
Maya.
|