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.

`#include <MFnWireDeformer.h>`

Inheritance diagram for MFnWireDeformer:

## 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) |

Creates a new wire deformer. | |

MStatus | addGeometry (const MObject &object) |

Adds a piece of geometry to the deformation. | |

MStatus | removeGeometry (const MObject &object) |

Removes a piece of geometry from the deformation. | |

MStatus | getAffectedGeometry (MObjectArray &objects) |

The geometry affected by this deformer is packed into the provided list of MObjects. | |

unsigned int | numWires (MStatus *ReturnStatus=NULL) const |

returns the number of wire curves connected to this deformer. | |

MStatus | addWire (const MObject &object) |

Adds a new wire curve to the deformation. | |

MObject | wire (unsigned int wireIndex, MStatus *ReturnStatus=NULL) |

Return the wire at the given index. | |

float | wireDropOffDistance (unsigned int wireIndex, MStatus *ReturnStatus=NULL) const |

Return the drop off distance of the wire at the given index. | |

MStatus | setWireDropOffDistance (unsigned int wireIndex, float dropOff) |

Sets the drop off distance of the wire at the given index. | |

float | wireScale (unsigned int wireIndex, MStatus *ReturnStatus=NULL) const |

Return the radial scale of the wire at the given index. | |

MStatus | setWireScale (unsigned int wireIndex, float scale) |

Sets the radial scale value of the wire at the given index. | |

MObject | holdingShape (unsigned int wireIndex, MStatus *ReturnStatus=NULL) const |

Returns the holding shape for the given wire. | |

MStatus | setHoldingShape (unsigned int wireIndex, MObject holdingCurve) |

Sets the holding shape for the given wire. | |

float | envelope (MStatus *ReturnStatus=NULL) const |

Returns the envelope for this deformer. | |

MStatus | setEnvelope (float envelope) |

Sets the envelope for this deformer. | |

float | rotation (MStatus *ReturnStatus=NULL) const |

Returns the rotation value for this deformer. | |

MStatus | setRotation (float rotation) |

Sets the rotation value for this deformer. | |

float | localIntensity (MStatus *ReturnStatus=NULL) const |

Returns the local intensity for this wire deformer. | |

MStatus | setLocalIntensity (float localIntensity) |

Sets the local intensity for this wire deformer. | |

float | crossingEffect (MStatus *ReturnStatus=NULL) const |

Returns the crossing effect for this wire deformer. | |

MStatus | setCrossingEffect (float crossingEffect) |

Sets the crossing effect for this wire deformer. | |

unsigned int | numDropoffLocators (unsigned int wireIndex, MStatus *ReturnStatus=NULL) const |

Returns the number of drop off locators. | |

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

Sets the parameters of a drop off locator. | |

MStatus | getDropoffLocator (unsigned int wireIndex, unsigned int locatorIndex, float ¶m, float &percentage) |

Gets the parameters of a drop off locator. | |

MFnWireDeformer (const MObject &object, MStatus *ReturnStatus=NULL) | |

Constructor. | |

## Protected Member Functions | |

virtual const char * | className () const |

Class name. |

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:****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

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:****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

MFn::Type type | ( | ) | const` [virtual]` |

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

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:****MS::kSuccess**operation successful**MS::kFailure**unexpected failure**MS::kLicenseFailure**application not licensed for attempted operation**MS::kInsufficientMemory**out of memory

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:****MS::kSuccess**operation successful**MS::kFailure**addition of geometry failed**MS::kInsufficientMemory**out of memory

Removes a piece of geometry from the deformation.

**Parameters:**-
[in] object the geometry

**Returns:**- Return status

**Status Codes:****MS::kSuccess**operation successful**MS::kFailure**addition of geometry failed**MS::kInsufficientMemory**out of memory

MStatus 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:****MS::kSuccess**operation successful**MS::kFailure**function set doesn not have a valid object**MS::kInsufficientMemory**out of memory

unsigned int 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:****MS::kSuccess**operation successful**MS::kFailure**function set doesn not have a valid object

Adds a new wire curve to the deformation.

**Parameters:**-
[in] object the new wire

**Returns:**- Return status

**Status Codes:****MS::kSuccess**operation successful**MS::kFailure**addition of geometry failed**MS::kInsufficientMemory**out of memory

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:****MS::kSuccess**operation successful**MS::kFailure**function set does not have a valid object**MS::kInvalidParameter**index is out of range

float 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:****MS::kSuccess**operation successful**MS::kFailure**function set does not have a valid object**MS::kInvalidParameter**index is out of range

MStatus 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:****MS::kSuccess**operation successful**MS::kFailure**function set does not have a valid object**MS::kInvalidParameter**index is out of range

float 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:****MS::kSuccess**operation successful**MS::kFailure**function set does not have a valid object**MS::kInvalidParameter**index is out of range

MStatus 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:****MS::kSuccess**operation successful**MS::kFailure**function set does not have a valid object**MS::kInvalidParameter**index is out of range

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:****MS::kSuccess**operation successful**MS::kFailure**function set does not have a valid object**MS::kInvalidParameter**index is out of range

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:****MS::kSuccess**operation successful**MS::kFailure**function set does not have a valid object**MS::kInvalidParameter**index is out of range

float 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:****MS::kSuccess**operation successful**MS::kFailure**function set does not have a valid object

MStatus 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:****MS::kSuccess**operation successful**MS::kFailure**function set does not have a valid object

float 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:****MS::kSuccess**operation successful**MS::kFailure**function set does not have a valid object

MStatus 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:****MS::kSuccess**operation successful**MS::kFailure**function set does not have a valid object

float 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:****MS::kSuccess**operation successful**MS::kFailure**function set does not have a valid object

MStatus 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.

**Parameters:**-
[in] localIntensity New local intensity value

**Returns:**- Status code

**Status Codes:****MS::kSuccess**operation successful**MS::kFailure**function set does not have a valid object

float 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:****MS::kSuccess**operation successful**MS::kFailure**function set does not have a valid object

MStatus setCrossingEffect | ( | float | crossingEffect | ) |

Sets 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:**-
[in] crossingEffect New crossing effect value

**Returns:**- Status code

**Status Codes:****MS::kSuccess**operation successful**MS::kFailure**function set does not have a valid object

unsigned int 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:****MS::kSuccess**operation successful**MS::kFailure**function set does not have a valid object**MS::kInvalidParameter**index is out of range

MStatus 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:****MS::kSuccess**operation successful**MS::kFailure**function set does not have a valid object**MS::kInvalidParameter**index is out of range

MStatus 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:****MS::kSuccess**operation successful**MS::kFailure**function set does not have a valid object**MS::kInvalidParameter**index is out of range