MFnWireDeformer Class Reference
[OpenMayaAnim - API module for animationFunctionSet classes]

#include <MFnWireDeformer.h>
Inheritance diagram for MFnWireDeformer:
Inheritance graph
[legend]
Collaboration diagram for MFnWireDeformer:
Collaboration graph
[legend]

List of all members.


Detailed Description

wire deformer function set

MFnWireDeformer is the function set for wire deformers. Wire deformers modify geometry based on its proximity to controlling wire curves. As the wire curves are modified, the parts of the geometry close to the curve will follow.

The wire 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.


Public Member Functions

virtual MFn::Type  type () const
  Function set type.
virtual  ~MFnWireDeformer ()
  Destructor.
  MFnWireDeformer ()
  Default constructor.
  MFnWireDeformer (MObject &object, MStatus *ReturnStatus=NULL)
  Constructor.
MObject  create (MStatus *ReturnStatus=NULL)
MStatus  addGeometry (const MObject &object)
MStatus  removeGeometry (const MObject &object)
MStatus  getAffectedGeometry (MObjectArray &objects)
unsigned int  numWires (MStatus *ReturnStatus=NULL) const
MStatus  addWire (const MObject &object)
MObject  wire (unsigned int wireIndex, MStatus *ReturnStatus=NULL)
float  wireDropOffDistance (unsigned int wireIndex, MStatus *ReturnStatus=NULL) const
MStatus  setWireDropOffDistance (unsigned int wireIndex, float dropOff)
float  wireScale (unsigned int wireIndex, MStatus *ReturnStatus=NULL) const
MStatus  setWireScale (unsigned int wireIndex, float scale)
MObject  holdingShape (unsigned int wireIndex, MStatus *ReturnStatus=NULL) const
MStatus  setHoldingShape (unsigned int wireIndex, MObject holdingCurve)
float  envelope (MStatus *ReturnStatus=NULL) const
MStatus  setEnvelope (float envelope)
float  rotation (MStatus *ReturnStatus=NULL) const
MStatus  setRotation (float rotation)
float  localIntensity (MStatus *ReturnStatus=NULL) const
MStatus  setLocalIntensity (float localIntensity)
float  crossingEffect (MStatus *ReturnStatus=NULL) const
MStatus  setCrossingEffect (float crossingEffect)
unsigned int  numDropoffLocators (unsigned int wireIndex, MStatus *ReturnStatus=NULL) const
MStatus  setDropoffLocator (unsigned int wireIndex, unsigned int locatorIndex, float param, float percentage)
MStatus  getDropoffLocator (unsigned int wireIndex, unsigned int locatorIndex, float &param, float &percentage)
  MFnWireDeformer (const MObject &object, MStatus *ReturnStatus=NULL)
  Constructor.

Protected Member Functions

virtual const char *  className () const
  Class name.

Constructor & Destructor Documentation

MFnWireDeformer::MFnWireDeformer ( MObject object,
MStatus ReturnStatus = NULL  
)

Constructor.

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

Parameters:
[in]  object  The MObject to attach the function set to
[out]  ReturnStatus  the return status
Status Codes:

MFnWireDeformer::MFnWireDeformer ( const MObject object,
MStatus ReturnStatus = NULL  
)

Constructor.

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

Parameters:
[in]  object  The MObject to attach the function set to
[out]  ReturnStatus  the return status
Status Codes:

Member Function Documentation

MFn::Type MFnWireDeformer::type (  )  const [virtual]

Function set type.

Return the class type : MFn::kWire

Reimplemented from MFnDependencyNode.

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

Class name.

Return the class name : "MFnWireDeformer"

Reimplemented from MFnDependencyNode.

MObject MFnWireDeformer::create ( MStatus ReturnStatus = NULL  ) 

Creates a new wire deformer. This function set's object is set to be the new wire deformer node.

Parameters:
[out]  ReturnStatus  return status
Returns:
Returns a handle to the new deformer
Status Codes:

MStatus MFnWireDeformer::addGeometry ( const MObject object  ) 

Adds a piece of geometry to the deformation.

After adding new geometry to the deformation. The new geometry will then be deformed by the existing wires.

Parameters:
[in]  object  the geometry
Returns:
Return status
Status Codes:

MStatus MFnWireDeformer::removeGeometry ( const MObject object  ) 

Removes a piece of geometry from the deformation.

Parameters:
[in]  object  the geometry
Returns:
Return status
Status Codes:

MStatus MFnWireDeformer::getAffectedGeometry ( MObjectArray objects  ) 

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.

Parameters:
[out]  objects  storage for the returned array
Returns:
Return status
Status Codes:

unsigned int MFnWireDeformer::numWires ( MStatus ReturnStatus = NULL  )  const

returns the number of wire curves connected to this deformer.

Parameters:
[out]  ReturnStatus  return status
Returns:
The number of wires
Status Codes:

MStatus MFnWireDeformer::addWire ( const MObject object  ) 

Adds a new wire curve to the deformation.

Parameters:
[in]  object  the new wire
Returns:
Return status
Status Codes:

MObject MFnWireDeformer::wire ( unsigned int  wireIndex,
MStatus ReturnStatus = NULL  
)

Return the wire at the given index. The returned object will be a nurbs curve shape suitable for use with the MFnNurbsCurve function set.

Parameters:
[in]  wireIndex  index of wire to return
[out]  ReturnStatus  return status
Returns:
A handle to the given wire curve
Status Codes:

float MFnWireDeformer::wireDropOffDistance ( unsigned int  wireIndex,
MStatus ReturnStatus = NULL  
) const

Return the drop off distance of the wire at the given index. Increasing this value will give the wire a greater area of influence.

Parameters:
[in]  wireIndex  index of wire to return the drop off distance for
[out]  ReturnStatus  return status
Returns:
The drop off distance
Status Codes:

MStatus MFnWireDeformer::setWireDropOffDistance ( unsigned int  wireIndex,
float  dropOff  
)

Sets the drop off distance of the wire at the given index. Increasing this value will give the wire a greater area of influence.

Parameters:
[in]  wireIndex  index of wire to set the drop off distance for
[in]  dropOff  new drop off value
Returns:
Return status
Status Codes:

float MFnWireDeformer::wireScale ( unsigned int  wireIndex,
MStatus ReturnStatus = NULL  
) const

Return the radial scale of the wire at the given index. The scale value affects how the wire modifies the geometry in its area of influence. A value of between 0.0 and 1.0 causes the wire to pull the surrounding geometry points towards itself. A value of greater than one causes the wire to repulse the geometry points around it. A value of exactly 1.0 causes the wire to neither pull nor push the points around it.

The surrounding points will always deform with the wire, The scale factor just allows the points around the wire to be radially scaled closer to or further from the wire.

Parameters:
[in]  wireIndex  index of wire to return the scale value for
[out]  ReturnStatus  return status
Returns:
The radial scale value
Status Codes:

MStatus MFnWireDeformer::setWireScale ( unsigned int  wireIndex,
float  scale  
)

Sets the radial scale value of the wire at the given index. The scale value affects how the wire modifies the geometry in its area of influence. A value of between 0.0 and 1.0 causes the wire to pull the surrounding geometry points towards itself. A value of greater than one causes the wire to repulse the geometry points around it. A value of exactly 1.0 causes the wire to neither pull nor push the points around it.

The surrounding points will always deform with the wire, The scale factor just allows the points around the wire to be radially scaled closer to or further from the wire.

Parameters:
[in]  wireIndex  index of wire to set the drop off distance for
[in]  scale  new scale value
Returns:
Return status
Status Codes:

MObject MFnWireDeformer::holdingShape ( unsigned int  wireIndex,
MStatus ReturnStatus = NULL  
) const

Returns the holding shape for the given wire. The holding shape may be a nurbs curve or a nurbs surface. If the given wire does not have a holding shape, then a null MObject handle will be returned.

A holding shape pins down the deforming shapes when the associated wire is moved. One possible application is to use a curve to limit the area that a wire affects.

Parameters:
[in]  wireIndex  index of wire to get the holding shape for
[out]  ReturnStatus  return status
Returns:
Return status
Status Codes:

MStatus MFnWireDeformer::setHoldingShape ( unsigned int  wireIndex,
MObject  holdingShape  
)

Sets the holding shape for the given wire. The holding shape may be a nurbs curve or a nurbs surface.

A holding shape pins down the deforming shapes when the associated wire is moved. One possible application is to use a curve to limit the area that a wire affects.

Parameters:
[in]  wireIndex  index of wire to set the holding shape for
[in]  holdingShape  nurbs curve or surface to use as holding shape
Returns:
Return status
Status Codes:

float MFnWireDeformer::envelope ( MStatus ReturnStatus = NULL  )  const

Returns the envelope for this deformer.

The envelope is a scale factor that affects the dropoff distances of all wires that belong to this deformer.

Parameters:
[in]  ReturnStatus  return status
Returns:
The envelope value
Status Codes:

MStatus MFnWireDeformer::setEnvelope ( float  envelope  ) 

Sets the envelope for this deformer.

The envelope is a scale factor that affects the dropoff distances of all wires that belong to this deformer.

Parameters:
[in]  envelope  envelope value
Returns:
Return status
Status Codes:

float MFnWireDeformer::rotation ( MStatus ReturnStatus = NULL  )  const

Returns the rotation value for this deformer.

The rotation value determines how much the tangency of the wire curve affects the deformation. When the rotation value is 0.0, the deformation will be linear. The geometry will pull straight towards the wire. When the rotation value is 1.0, the tangency of the wire curve is taken into effect. This will provide more natural deformations when the wire curve is twisted with respect to its original position. The surface will pull towards the wire in an arc rather than in a straight line.

Parameters:
[out]  ReturnStatus  return status
Returns:
The rotation value
Status Codes:

MStatus MFnWireDeformer::setRotation ( float  rotation  ) 

Sets the rotation value for this deformer.

The rotation value determines how much the tangency of the wire curve affects the deformation. When the rotation value is 0.0, the deformation will be linear. The geometry will pull straight towards the wire. When the rotation value is 1.0, the tangency of the wire curve is taken into effect. This will provide more natural deformations when the wire curve is twisted with respect to its original position. The surface will pull towards the wire in an arc rather than in a straight line.

Parameters:
[in]  rotation  new rotation value
Returns:
Return status
Status Codes:

float MFnWireDeformer::localIntensity ( MStatus ReturnStatus = NULL  )  const

Returns the local intensity for this wire deformer.

The local intensity has an effect when two wire curves are positioned close to each other. Normally, only the most deformed of the two curves will affect the surface. When the local intensity is increased, the less deformed curve will start to pull the surface back towards itself.

Parameters:
[out]  ReturnStatus  return status
Returns:
The local intensity value
Status Codes:

MStatus MFnWireDeformer::setLocalIntensity ( float  localIntensity  ) 

Sets the local intensity for this wire deformer.

The local intensity has an effect when two wire curves are positioned close to each other. Normally, only the most deformed of the two curves will affect the surface. When the local intensity is increased, the less deformed curve will start to pull the surface back towards itself.

Returns:
The local intensity value
Status Codes:

float MFnWireDeformer::crossingEffect ( MStatus ReturnStatus = NULL  )  const

Returns the crossing effect for this wire deformer.

The crossing effect applies when two wire curves cross each other. Normally, the deformation is dampened so that the surface is only affected by the most deformed curve at the intersection point. When the crossing effect is increased, the effect of the wires becomes additive. So, the object will be deform more near crossing wires.

Parameters:
[out]  ReturnStatus  return status
Returns:
The crossing effect value
Status Codes:

MStatus MFnWireDeformer::setCrossingEffect ( float  crossingEffect  ) 

Sets the local intensity for this wire deformer.

The local intensity has an effect when two wire curves are positioned close to each other. Normally, only the most deformed of the two curves will affect the surface. When the local intensity is increased, the less deformed curve will start to pull the surface back towards itself.

Returns:
The local intensity value
Status Codes:

unsigned int MFnWireDeformer::numDropoffLocators ( unsigned int  wireIndex,
MStatus ReturnStatus = NULL  
) const

Returns the number of drop off locators.

A drop off locator allows the modification the wire curve drop off distance at a specific point on the wire curve.

Parameters:
[in]  wireIndex  the index of the wire curve to query
[out]  ReturnStatus  return status
Returns:
The number of drop off locators for the given curve
Status Codes:

MStatus MFnWireDeformer::setDropoffLocator ( unsigned int  wireIndex,
unsigned int  locatorIndex,
float  param,
float  percentage  
)

Sets the parameters of a drop off locator.

A drop off locator allows the modification the wire curve drop off distance at a specific point on the wire curve.

Parameters:
[in]  wireIndex  index of the wire curve
[in]  locatorIndex  index of the locator on the given wire
[in]  param  new param value along the curve at which to position the locator
[in]  percentage  percentage of the drop off distance applied
Returns:
Return status
Status Codes:

MStatus MFnWireDeformer::getDropoffLocator ( unsigned int  wireIndex,
unsigned int  locatorIndex,
float &  param,
float &  percentage  
)

Gets the parameters of a drop off locator.

A drop off locator allows the modification the wire curve drop off distance at a specific point on the wire curve.

Parameters:
[in]  wireIndex  index of the wire curve
[in]  locatorIndex  index of the locator on the given wire
[in]  param  storage for the param value along the curve that the locator is positioned at
[in]  percentage  storage for the percentage value of the locator
Returns:
Return status
Status Codes:

Autodesk® Maya® 2011 © 1997-2010 Autodesk, Inc. All rights reserved. Generated with doxygen 1.5.6