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>
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.
[in] | object | The MObject to attach the function set to |
[out] | ReturnStatus | the return status |
MFnWireDeformer | ( | const MObject & | object, |
MStatus * | ReturnStatus =
NULL |
||
) |
Constructor.
Class constructor that initializes the function set to the given MObject.
[in] | object | The MObject to attach the function set to |
[out] | ReturnStatus | the return status |
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.
[out] | ReturnStatus | return status |
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.
[in] | object | the geometry |
Removes a piece of geometry from the deformation.
[in] | object | the geometry |
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.
[out] | objects | storage for the returned array |
unsigned int numWires | ( | MStatus * | ReturnStatus =
NULL |
) | const |
returns the number of wire curves connected to this deformer.
[out] | ReturnStatus | return status |
Adds a new wire curve to the deformation.
[in] | object | the new wire |
Return the wire at the given index.
The returned object will be a nurbs curve shape suitable for use with the MFnNurbsCurve function set.
[in] | wireIndex | index of wire to return |
[out] | ReturnStatus | return status |
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.
[in] | wireIndex | index of wire to return the drop off distance for |
[out] | ReturnStatus | return status |
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.
[in] | wireIndex | index of wire to set the drop off distance for |
[in] | dropOff | new drop off value |
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.
[in] | wireIndex | index of wire to return the scale value for |
[out] | ReturnStatus | return status |
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.
[in] | wireIndex | index of wire to set the drop off distance for |
[in] | scale | new scale value |
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.
[in] | wireIndex | index of wire to get the holding shape for |
[out] | ReturnStatus | return status |
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.
[in] | wireIndex | index of wire to set the holding shape for |
[in] | holdingShape | nurbs curve or surface to use as holding shape |
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.
[in] | ReturnStatus | return status |
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.
[in] | envelope | envelope value |
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.
[out] | ReturnStatus | return status |
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.
[in] | rotation | new rotation value |
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.
[out] | ReturnStatus | return status |
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.
[in] | localIntensity | New local intensity value |
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.
[out] | ReturnStatus | return status |
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.
[in] | crossingEffect | New crossing effect value |
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.
[in] | wireIndex | the index of the wire curve to query |
[out] | ReturnStatus | return status |
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.
[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 |
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.
[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 |