
hohehohe2's OpenMaya tutorial
kotamuraa@yahoo.co.jp
6. Dependency graph(DG)
(This chapter may be quite inaccurate)
Dependency graph and attribute
Dependency graph is another graph in Maya.
All DG nodes do is to calculate outputs (output attributes)
from
inputs (input attributes).
- There are many types of attributes, such as
(???: I'm quite unsure here)
bool, char, uChar, short, long, int, float, double, time,
short2, long2, int2, float2, double2,
short3, long3, int3, float3, double3,
vector, floatVector, matrix, floatMatrix,
string,
nurbsCurve, nurbsSurface, mesh, subdSurface,
nurbsCurveTransformed, nurbsSurfaceTransformed,
meshTransformed, subdSurfaceTransformed,
geometryTransformMatrix, pluginData
You can make an array of attributes (array attribute), or
pack it in one attribute like a structure variable in C.
You can also make your own attribute types. you can tell
your new C++ class as an attribute type to Maya.
(HELP: I refereed to a as**() method of MDataHandle documentation
but I find there are attributes in MFnNumericAttribute class
that can not be seen in as**() method, such as kByte.)
(HELP: Also there are kCOmponetList in MFnData. Why?)
(HELP: MFnUInt64ArrayData is what k** type?)
(HELP: What is the MFn**Data that handles kDynArrayAttrs
type?)
(HELP: Where can I find documents about these stuff?)
If the type is same you can connect two attributes of different
nodes.
(One must be declared as an input attribute and the other must
be
declared as an output attribute.)
When a connection is made, the value of the input attribute
gets the value of output attribute.
In Hypergraph, usually transform nodes do not connect
to any other nodes, so it may seem
to be useless, but it has an important role in DAG, it just
doesn't have a connection in DG.
(I think DAG can be merged to DG if a DAG node can pass a matrix
data to the parent node
in DG. Maybe it's not a good idea anyway.)
For example Making a blinn node and assign it to polygon sphere:
A new blinn node(blinn1), and shadingEngine node(blinn1SG)
is created, and
the following connections are made.
- outColor attribute of a blinn node -> surfaceShader
attribute of a shadingEngine node
Type of the data flows between
them is "float3"
- instObjGroups[0] attribute of a mesh node ->
dagSetMembers[0] attribute of a shadingEngine node.
Type of the data flows between
them is "TdataCompound"
instObjGroups and dagSetMembers are
arrays of attributes so it means a
member of each node is connected
Check the type of the data (type of attribute) in MEL command like
getAttr -type polySphere1.output;
Maya uses this dependency graph whenever it is necessary.
supplement: When an attribute of a node is connected another,
the attribute is always affected to another,
but Maya also change the attributes of nodes, such as the uppermost
nodes of connections.
(HELP) Where can I find the document What attributes of What
nodes Maya changes in What timing??
inclusive relations
The next chart is a summary of the inclusive relations.
Maya's internal data
(proper Maya API manual term is Maya object) will be described
later.
DAG nodes are DG nodes.
Prev Contents Next
Maya is a registered
trademark of Autodesk
Copyright
© 2003, Koichi Tamura. All Rights Reserved.