class MFnLatticeDeformer

Jump to documentation

: public MFnDependencyNode FFD lattice deformer function set (OpenMayaAnim) (OpenMayaAnim.py)

Inheritance:

MFnLatticeDeformer < MFnDependencyNode < MFnBase

public members:

MFnLatticeDeformer ()
MFnLatticeDeformer ( MObject & object, MStatus * ReturnStatus = NULL )
virtual ~MFnLatticeDeformer ()
virtual MFn::Type type () const
MObject create ( unsigned int xDiv, unsigned int yDiv, unsigned int zDiv, MStatus * ReturnStatus = NULL )
MStatus addGeometry ( const MObject & object )
MStatus removeGeometry ( const MObject & object )
MStatus getAffectedGeometry ( MObjectArray & objects )
MStatus getDivisions ( unsigned int & x, unsigned int & y, unsigned int & z )
MStatus setDivisions ( unsigned int x, unsigned int y, unsigned int z )
MStatus resetLattice ( bool centerLattice = false )
MObject deformLattice ( MStatus * ReturnStatus = NULL )
MObject baseLattice ( MStatus * ReturnStatus = NULL )
MFnLatticeDeformer ( const MObject & object, MStatus * ReturnStatus = NULL )

Inherited from MFnDependencyNode:

public members:

virtual MFn::Type type () const
enum MAttrClass
kGlobalDynamicAttr
kLocalDynamicAttr
MObject create ( const MTypeId & typeId , MStatus * ReturnStatus = NULL )
MObject create ( const MTypeId & typeId , const MString & name , MStatus * ReturnStatus = NULL )
MObject create ( const MString & type , MStatus * ReturnStatus = NULL )
MObject create ( const MString & type , const MString & name , MStatus * ReturnStatus = NULL )
MTypeId typeId ( MStatus * ReturnStatus = NULL ) const
MString typeName ( MStatus * ReturnStatus = NULL ) const
MString name ( MStatus * ReturnStatus = NULL ) const
MString setName ( const MString & name , MStatus * ReturnStatus = NULL )
MStatus getConnections ( MPlugArray & array ) const
unsigned int attributeCount ( MStatus * ReturnStatus=NULL) const
MObject attribute ( unsigned int index, MStatus * ReturnStatus=NULL) const
MObject reorderedAttribute ( unsigned int index, MStatus * ReturnStatus=NULL) const
MObject attribute ( const MString & attrName, MStatus * ReturnStatus=NULL) const
MAttrClass attributeClass ( const MObject & attr, MStatus * ReturnStatus=NULL) const
MStatus getAffectedAttributes ( const MObject & attr, MObjectArray & affectedAttributes ) const
MStatus getAffectedByAttributes ( const MObject & attr, MObjectArray & affectedByAttributes ) const
MPlug findPlug ( const MObject & attr, bool wantNetworkedPlug, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MString & attrName, bool wantNetworkedPlug, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MObject & attr, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MString & attrName, MStatus * ReturnStatus=NULL) const
MStatus addAttribute ( const MObject & attr, MAttrClass type = kLocalDynamicAttr )
MStatus removeAttribute ( const MObject & attr, MAttrClass type = kLocalDynamicAttr )
MPxNode * userNode ( MStatus * ReturnStatus=NULL ) const
bool isFromReferencedFile ( MStatus * ReturnStatus=NULL) const
bool isShared ( MStatus * ReturnStatus=NULL) const
bool hasUniqueName ( MStatus * ReturnStatus=NULL) const
MString parentNamespace ( MStatus * ReturnStatus=NULL) const
bool isLocked ( MStatus * ReturnStatus=NULL) const
MStatus setLocked ( bool locked )
static MString classification ( const MString & nodeTypeName )
bool isNewAttribute ( const MObject & attr, MStatus * ReturnStatus=NULL) const
static unsigned int allocateFlag ( const MString pluginName, MStatus * ReturnStatus=NULL )
static MStatus deallocateFlag (const MString pluginName, unsigned int flag)
static MStatus deallocateAllFlags (const MString pluginName)
MStatus setFlag (unsigned int flag, bool state)
bool isFlagSet (unsigned int flag, MStatus * ReturnStatus=NULL) const
bool isDefaultNode ( MStatus * ReturnStatus=NULL) const
MStatus setDoNotWrite ( bool flag )
bool canBeWritten ( MStatus * ReturnStatus=NULL) const
bool hasAttribute (const MString & name , MStatus * ReturnStatus=NULL) const
MObject getAliasAttr (bool force, MStatus * ReturnStatus=NULL)
bool setAlias (const MString & alias,const MString & name , const MPlug & plug, bool add=true, MStatus * ReturnStatus=NULL)
bool findAlias (const MString & alias, MObject & attrObj, MStatus * ReturnStatus=NULL) const
bool getAliasList ( MStringArray & strArray, MStatus * ReturnStatus=NULL)
MString plugsAlias (const MPlug & plug, MStatus * ReturnStatus=NULL)
public
bool getPlugsAlias (const MPlug & plug, MString & aliasName, MStatus * ReturnStatus=NULL)

Inherited from MFnBase:

public members:

virtual MFn::Type type () const
bool hasObj ( MFn::Type ) const
bool hasObj ( const MObject & ) const
MObject object ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( MObject & object )
virtual MStatus setObject ( const MObject & object )

Documentation

Function set for FFD lattice deformer
Description

MFnLatticeDeformer is the function set for lattice deformers. Lattice deformers use FFDs to deform geometry.

The lattice deformer is actually a small network of dependency nodes in the dependency graph. This function set is provided to make manipulation of the network easier. The main deformer node should be given to this function set as its object.

There are two lattices associated with a lattice deformer. There is a base lattice that defines the start position for the lattice. The second lattice is the version that is modified to deform the geometry. The difference between the two lattices defines the deformation that is applied to the geometry.

The base lattice is a very simple shape that only defines a box in space. The base lattice should be modified by using the standard DAG transformation support. The second deformable lattice has geometry that can be modified using the MFnLattice function set.

For a piece of geometry to be modified by this deformer, the geometry must be attached to the deformer (use addGeometry method) and the geometry must be contained within the base lattice. The resetLattice method can be used to make the lattice resize to the bounding box of the attached geometry.

Functions

MFnLatticeDeformer:: MFnLatticeDeformer ()

Description

Default class constructor. The function set is not attached to an MObject.

MFnLatticeDeformer:: MFnLatticeDeformer ( MObject & object, MStatus * ReturnStatus )

Description

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

Arguments

  • object the MObject to attach the function set to
  • ReturnStatus the return status
    • MS::kSuccess if the function set is successfully attached
    • MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnLatticeDeformer:: MFnLatticeDeformer ( const MObject & object, MStatus * ReturnStatus )

Description

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

Arguments

  • object the const MObject to attach the function set to
  • ReturnStatus the return status
    • MS::kSuccess if the function set is successfully attached
    • MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnLatticeDeformer:: ~MFnLatticeDeformer ()

Description

The class destructor.

MFn::Type MFnLatticeDeformer:: type () const

Description

Return the type of this function set.

Return Value

  • the constant MFn::kFFD

MObject MFnLatticeDeformer:: create ( unsigned int xDiv, unsigned int yDiv, unsigned int zDiv, MStatus * ReturnStatus )

Description

Creates a new lattice deformer with the given number of divisions. This function set's object is set to be the new lattice node.

Arguments

  • xDiv number of divisions in x (must be at least 2)
  • yDiv number of divisions in y (must be at least 2)
  • zDiv number of divisions in z (must be at least 2)
  • ReturnStatus return status

Return Value

  • returns a handle to the new deformer

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure unexpected failure
  • MS::kLicenseFailure application not licensed for attempted operation
  • MS::kInsufficientMemory out of memory

MStatus MFnLatticeDeformer:: addGeometry ( const MObject & object )

Description

Adds a piece of geometry to the deformation.

After adding new geometry to the deformation, one must make sure that the new geometry is contained within the base lattice for the deformation to affect it. The easiest way to do this is to reset the deformation with the flag that causes it to expand the base lattice to the bounding box of all of the contained geometry.

Arguments

  • object the geometry

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure addition of geometry failed
  • MS::kInsufficientMemory out of memory

MStatus MFnLatticeDeformer:: removeGeometry ( const MObject & object )

Description

Removes a piece of geometry from the deformation.

Arguments

  • objectthe geometry

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure addition of geometry failed
  • MS::kInsufficientMemory out of memory

MStatus MFnLatticeDeformer:: getAffectedGeometry ( MObjectArray & objects )

Description

The geometry affected by this deformer is packed into the provided list of MObjects. Each of the MObjects will be a DAG node that has geometry.

Arguments

  • objects storage for the returned array

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set doesn not have a valid object
  • MS::kInsufficientMemory out of memory

MStatus MFnLatticeDeformer:: getDivisions ( unsigned int & x, unsigned int & y, unsigned int & z )

Description

Retrieve the number of divisions in each of the X, Y, and Z directions. The number of divisions specifies the resolution of the lattice.

Arguments

  • x a reference parameter that on return contains the number of divisions in the X direction
  • y a reference parameter that on return contains the number of divisions in the Y direction
  • z a reference parameter that on return contains the number of divisions in the Z direction

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set doesn not have a valid object
  • MS::kInsufficientMemory out of memory

MStatus MFnLatticeDeformer:: setDivisions ( unsigned int x, unsigned int y, unsigned int z )

Description

Set the number of divisions in each of the X, Y, and Z directions. The number of divisions specifies the resolution of the lattice.

Arguments

  • x number of divisions in the X direction
  • y number of divisions in the Y direction
  • z number of divisions in the Z direction

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set doesn not have a valid object
  • MS::kInsufficientMemory out of memory

MStatus MFnLatticeDeformer:: resetLattice ( bool centerLattice )

Description

This method resets the deformed lattice to match the base lattice.

The center option will resize the lattice to be the bounding box of all contained geometry. If instanced objects are being deformed, then then centering option will take the first instance found. So, it is possible to get unexpected results when centering around instanced objects.

Arguments

  • centerLattice whether to center the lattice

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set doesn not have a valid object or there was an unexpected error

MObject MFnLatticeDeformer:: deformLattice ( MStatus * ReturnStatus )

Description

This returns the deformed version of the lattice. The deformed lattice is a shape in the DAG and should be modified using the MFnLattice function set.

Arguments

  • ReturnStatus return status

Return Value

  • handle for the deformed lattice shape

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set doesn not have a valid object or there was an unexpected error

MObject MFnLatticeDeformer:: baseLattice ( MStatus * ReturnStatus )

Description

This returns the base version of the lattice that describes the region of space deformed by the lattice. The returned base lattice is a shape in the DAG and can be accessed using the MFnDagNode function set.

Arguments

  • ReturnStatus return status

Return Value

  • handle for the base lattice shape

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set doesn not have a valid object or there was an unexpected error

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright