Public Member Functions | Protected Member Functions

MFnLattice Class Reference

This reference page is linked to from the following overview topics: Using the Maya Python API.


Search for all occurrences

Detailed Description

Lattice function set.

MFnLattice is the function set for lattice shapes and lattice geometry. It can be used on lattices in the DAG or on lattice geometry from a dependency node attribute.

Lattices are most commonly used for specifying FFDs (free-form deformations). See MFnLatticeDeformer for more information on those.

MFnLatticeData can be used to create new lattice data objects for use with dependency node attributes.

Examples:

latticeNoiseCmd.cpp, and latticeNoiseNode.cpp.

#include <MFnLattice.h>

Inheritance diagram for MFnLattice:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual MFn::Type type () const
 Function set type.
virtual ~MFnLattice ()
 Destructor.
 MFnLattice ()
 Default constructor.
 MFnLattice (MObject &object, MStatus *ReturnStatus=NULL)
 Constructor.
 MFnLattice (const MDagPath &object, MStatus *ret=NULL)
 Constructor.
MObject create (unsigned int xDiv, unsigned int yDiv, unsigned int zDiv, MObject parentOrOwner=MObject::kNullObj, MStatus *ReturnStatus=NULL)
 Create a new lattice.
MStatus reset (double sSize=1.0, double tSize=1.0, double uSize=1.0)
 Reset the lattice points to a uniform parallelipiped shape with the specified dimensions: sSize x tSize x uSize.
MStatus getDivisions (unsigned int &s, unsigned int &t, unsigned int &u)
 Get the number of divisions in the lattice.
MStatus setDivisions (unsigned int s, unsigned int t, unsigned int u)
 Set the number of divisions in the lattice.
MPointpoint (unsigned int s, unsigned int t, unsigned int u, MStatus *ReturnStatus=NULL)
 Returns the point in the lattice that is at the given indices.
 MFnLattice (const MObject &object, MStatus *ret=NULL)
 Constructor.

Protected Member Functions

virtual const char * className () const
 Class name.

Constructor & Destructor Documentation

~MFnLattice ( ) [virtual]

Destructor.

Class destructor.

MFnLattice ( MObject object,
MStatus ReturnStatus = NULL 
)

Constructor.

Class constructor that initializes the function set to the given MObject.

Parameters:
[in]objectThe MObject to attach the function set to
[out]ReturnStatusthe return status
Status Codes:
MFnLattice ( const MDagPath object,
MStatus ReturnStatus = NULL 
)

Constructor.

Class constructor that initializes the function set to the given constant MDagPath object.

Parameters:
[in]objectThe const MDagPath to attach the function set to
[out]ReturnStatusThe return status
Status Codes:
MFnLattice ( const MObject object,
MStatus ReturnStatus = NULL 
)

Constructor.

Class constructor that initializes the function set to the given MObject.

Parameters:
[in]objectThe MObject to attach the function set to
[out]ReturnStatusthe return status
Status Codes:

Member Function Documentation

MFn::Type type ( ) const [virtual]

Function set type.

Return the class type : MFn::kLattice.

Reimplemented from MFnDagNode.

const char * className ( ) const [protected, virtual]

Class name.

Return the class name : "MFnLattice".

Reimplemented from MFnDagNode.

MObject create ( unsigned int  xDiv,
unsigned int  yDiv,
unsigned int  zDiv,
MObject  parentOrOwner = MObject::kNullObj,
MStatus ReturnStatus = NULL 
)

Create a new lattice.

This can be used to create either a new lattice shape in the DAG, or to place new lattice geometry into a dependency graph lattice data object. Lattice data objects can be created with MFnLatticeData or can be obtained from an MDataHandle in the compute method of a dependency node.

The parentOrOwner argument is used to specify the owner of the new lattice.

If parentOrOwner is a kLatticeData data wrapper (e.g. as returned by MFnLatticeData::create) then a new kLattice object will be created and placed inside the wrapper. No nodes will be created and the method will return the kLattice object.

If parentOrOwner is NULL then new lattice and transform nodes will be created and added to the DAG, with the lattice parented under the transform. The method will return the transform node.

If parentOrOwner is a DAG node then a new lattice node will be created and parented under that DAG node. The method will return the lattice node.

Parameters:
[in]xDivLattice divisions in x (must be at least 2).
[in]yDivLattice divisions in y (must be at least 2).
[in]zDivLattice divisions in z (must be at least 2).
[in]parentOrOwnerParent node or data wrapper. See discussion above.
[out]ReturnStatusStatus code.
Returns:
A handle to the new lattice data, lattice node or transform node. See the discussion of the parentOrOwner parameter above for more details.
Status Codes:
MStatus reset ( double  sSize = 1.0,
double  tSize = 1.0,
double  uSize = 1.0 
)

Reset the lattice points to a uniform parallelipiped shape with the specified dimensions: sSize x tSize x uSize.

Parameters:
[in]sSizesize in s dimension
[in]tSizesize in t dimension
[in]uSizesize in u dimension
Returns:
Return status
Status Codes:
MStatus getDivisions ( unsigned int &  s,
unsigned int &  t,
unsigned int &  u 
)

Get the number of divisions in the lattice.

Parameters:
[out]sdivisions in s dimension
[out]tdivisions in t dimension
[out]udivisions in u dimension
Returns:
Return status
Status Codes:
MStatus setDivisions ( unsigned int  s,
unsigned int  t,
unsigned int  u 
)

Set the number of divisions in the lattice.

Parameters:
[in]sdivisions in s dimension
[in]tdivisions in t dimension
[in]udivisions in u dimension
Returns:
Return status
Status Codes:
MPoint & point ( unsigned int  s,
unsigned int  t,
unsigned int  u,
MStatus ReturnStatus = NULL 
)

Returns the point in the lattice that is at the given indices.

Parameters:
[in]ss index
[in]tt index
[in]uu index
[out]ReturnStatusreturn status
Returns:
The point
Status Codes:

MFnLattice MFnLattice MFnLattice MFnLattice MFnLattice MFnLattice MFnLattice MFnLattice MFnLattice MFnLattice
MFnLattice MFnLattice MFnLattice MFnLattice MFnLattice MFnLattice MFnLattice MFnLattice MFnLattice MFnLattice