Public Member Functions | Protected Member Functions

MFnGeometryFilter Class Reference

Search for all occurrences

Detailed Description

geometry filter function set

MFnGeometryFilter is the function set for geometry filters, the node that is the base class for deformers. Geometry filter nodes include clusters, ffds, nonlinears, user-defined deformers, sculpts, wires and blendShapes. The purpose of the geometry filter is to connect to the geometry that is deformed. The geometry filter is independent of any algorithm that calculates the deformation.

This function set provides methods for finding out which geometries are connected to geometry filter nodes.

#include <MFnGeometryFilter.h>

Inheritance diagram for MFnGeometryFilter:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual MFn::Type type () const
 Function set type.
virtual ~MFnGeometryFilter ()
 Destructor.
 MFnGeometryFilter ()
 Default constructor.
 MFnGeometryFilter (MObject &object, MStatus *ReturnStatus=NULL)
 Constructor.
MStatus getInputGeometry (MObjectArray &objects) const
 This method returns the input geometry for the deformer by traversing the graph to find upstream shape nodes.
MStatus getOutputGeometry (MObjectArray &objects) const
 The output geometry is packed into the provided list of MObjects.
MObject inputShapeAtIndex (unsigned int index, MStatus *ReturnStatus=NULL) const
 Returns the input shape corresponding to the plug index.
MObject outputShapeAtIndex (unsigned int index, MStatus *ReturnStatus=NULL) const
 Returns the output shape corresponding to the plug index.
unsigned int indexForOutputShape (const MObject &shape, MStatus *ReturnStatus=NULL) const
 Returns the plug index for the specified output shape.
MStatus getPathAtIndex (unsigned int index, MDagPath &path) const
 The DAG path of the output geometry at the specified plug index is put in the dagPath argument.
unsigned int indexForGroupId (unsigned int groupId, MStatus *ReturnStatus=NULL) const
 Returns the plug index corresponding to the groupId.
unsigned int groupIdAtIndex (unsigned int index, MStatus *ReturnStatus=NULL) const
 Returns the groupId at the specified plug index.
unsigned int numOutputConnections (MStatus *ReturnStatus=NULL) const
 Returns the number of output geometries connected to this node.
unsigned int indexForOutputConnection (unsigned int connectionIndex, MStatus *ReturnStatus=NULL) const
 Returns the plug index corresponding to the connection index.
MObject deformerSet (MStatus *ReturnStatus=NULL) const
 Returns the set containing the objects that are deformed.
float envelope (MStatus *ReturnStatus=NULL) const
 Returns the envelope value.
MStatus setEnvelope (float envelope)
 Sets the envelope value.
 MFnGeometryFilter (const MObject &object, MStatus *ReturnStatus=NULL)
 Constructor.

Protected Member Functions

virtual const char * className () const
 Class name.

Constructor & Destructor Documentation

MFnGeometryFilter ( 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:
MFnGeometryFilter ( 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::kGeometryFilt.

Reimplemented from MFnDependencyNode.

Reimplemented in MFnSkinCluster, and MFnWeightGeometryFilter.

MStatus getInputGeometry ( MObjectArray geomList) const

This method returns the input geometry for the deformer by traversing the graph to find upstream shape nodes.

It is possible for there to be nodes in between the shape and the deformer so that the returned shape may have a different topology or tweaks then the input data to the deformer. If the actual input geometry data for the deformer is required, this information can be accessed by using MPlug::getValue() to query the inputGeometry attribute on the deformer.

The input geometry is packed into the provided list of MObjects. Each of the MObjects will be a DAG node.

Parameters:
[out]geomListstorage for the returned array
Returns:
MStatus getOutputGeometry ( MObjectArray geomList) const

The output geometry is packed into the provided list of MObjects.

Each of the MObjects will be a DAG node.

Parameters:
[out]geomListstorage for the returned array
Returns:
MObject inputShapeAtIndex ( unsigned int  index,
MStatus ReturnStatus = NULL 
) const

Returns the input shape corresponding to the plug index.

Parameters:
[in]indexthe plug index for the input shape
[out]ReturnStatusreturn status
Returns:
The input shape corresponding to the plug index
Status Codes:
MObject outputShapeAtIndex ( unsigned int  index,
MStatus ReturnStatus = NULL 
) const

Returns the output shape corresponding to the plug index.

Parameters:
[in]indexthe plug index for the output shape
[out]ReturnStatusreturn status
Returns:
The output shape corresponding to the plug index
Status Codes:
unsigned int indexForOutputShape ( const MObject shape,
MStatus ReturnStatus = NULL 
) const

Returns the plug index for the specified output shape.

Parameters:
[in]shapethe shape for which the plug index is requested
[out]ReturnStatusreturn status
Returns:
The plug index leading to the specified shape
Status Codes:
MStatus getPathAtIndex ( unsigned int  index,
MDagPath dagPath 
) const

The DAG path of the output geometry at the specified plug index is put in the dagPath argument.

Parameters:
[in]indexthe plug index
[out]dagPaththe DAG path whose index is requested
Returns:
unsigned int indexForGroupId ( unsigned int  groupId,
MStatus ReturnStatus = NULL 
) const

Returns the plug index corresponding to the groupId.

This ID can change from one Maya session to another, but it is unique for each Maya session.

Parameters:
[in]groupIdthe groupId for the plug index
[out]ReturnStatusreturn status
Returns:
The plug index corresponding to the groupId
Status Codes:
unsigned int groupIdAtIndex ( unsigned int  index,
MStatus ReturnStatus = NULL 
) const

Returns the groupId at the specified plug index.

Parameters:
[in]indexthe plug index for which the groupId is requested
[out]ReturnStatusreturn status
Returns:
The groupId at the specified index
Status Codes:
unsigned int numOutputConnections ( MStatus ReturnStatus = NULL) const

Returns the number of output geometries connected to this node.

This is typically equal to the number of input geometries unless an input or output geometry has been deleted, or a connection to an input or output geometry has been broken.

This method is useful in conjunction with indexForOutputConnection to iterate through the affected objects.

For example:

    MFnGeometryFilter Fn(mObject);
    unsigned int numConnections = Fn.numOutputConnections();
    for (unsigned int i = 0; i < numConnections; i++) {
        unsigned int plugIndex = Fn.indexForOutputConnection(i);
        // perform an operation on that plugIndex
    }
Parameters:
[out]ReturnStatusreturn status
Returns:
The number of outputs
Status Codes:
unsigned int indexForOutputConnection ( unsigned int  connectionIndex,
MStatus ReturnStatus = NULL 
) const

Returns the plug index corresponding to the connection index.

The connection index is the index specifying the nth output connection. The plug index (logical index) is the sparse array index used by many of MFnGeometryFilter's methods and in MEL scripts. The connection index is 0-based, hence, the maximum value of the connection index is numOutputs - 1.

Parameters:
[in]connectionIndexthe connection index
[out]ReturnStatusreturn status
Returns:
The plug index corresponding to the connection index
Status Codes:
MObject deformerSet ( MStatus ReturnStatus = NULL) const

Returns the set containing the objects that are deformed.

Adding new components to the deformer set will cause them to be deformed. Removing components from the deformer set will prevent them from being influenced by the deformer.

Note that the wrap deformer and the skinCluster deformers are special cases. They allow only a single object to be deformed per wrap/skinCluster, so adding additional geometries to a wrap or skinCluster node will have no effect.

Parameters:
[out]ReturnStatusreturn status
Returns:
The set containing the objects that are deformed
Status Codes:
float envelope ( MStatus ReturnStatus = NULL) const

Returns the envelope value.

The envelope is a global scale factor that is applied to all the values.

Parameters:
[out]ReturnStatusreturn status
Returns:
The envelope value
Status Codes:
MStatus setEnvelope ( float  envelope)

Sets the envelope value.

The envelope is a global scale factor that is applied to all the values.

Parameters:
[in]envelopeenvelope value
Returns:

MFnGeometryFilter MFnGeometryFilter MFnGeometryFilter MFnGeometryFilter MFnGeometryFilter MFnGeometryFilter MFnGeometryFilter MFnGeometryFilter MFnGeometryFilter MFnGeometryFilter
MFnGeometryFilter MFnGeometryFilter MFnGeometryFilter MFnGeometryFilter MFnGeometryFilter MFnGeometryFilter MFnGeometryFilter MFnGeometryFilter MFnGeometryFilter MFnGeometryFilter