Dynamics Fields allow maya users
to affect particle systems, soft bodies and cloth in a number
of pre-defined ways. The field types Maya currently supports are
:
MFn::kAir
MFn::kDrag
MFn::kGravity
MFn::kNewton
MFn::kRadial
MFn::kTurbulence
MFn::kUniform
MFn::kVortex
MFn::kVolumeAxis
All of those types are derived from
the general base class MFn::kField. This inturn is derived from
an MFn::kTransform node. This means that accessing most of the
field data, has already been covered in the transform and animation
chapters. Additional information can be extracted using a specialised
function set for each field type.
Shared Field Data
The base class of all dynamics fields has some generic attributes
that control the force and distance range over which the field
is active.
#include<maya/MFnField.h>
void OutputField(MObject&
obj )
{
// attach
the function set to the object
MFnField fn(obj);
// fields are inherited from transform
nodes. We may
// as well re-use our transform functions
outputTransformData(obj); outputParentingInfo(obj);