- Main Page
- Related Pages
- Modules
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Friends

# MnCloth Class Reference

# OpenMayaFX - API module for effects

Search for all occurrences

## Detailed Description

Class for wrapping N cloth objects.

This class wraps the internal Maya representation of N cloth objects suitable for use with the Nucleus solver.

Examples:

  testNobjectNode.h, and testNucleusNode.cpp.

`#include <MnCloth.h>`

Inheritance diagram for MnCloth:
[legend]

List of all members.

## Public Member Functions
| MnCloth ()
| Default constructor.
virtual | ~MnCloth ()
| The class destructor.
MStatus | createNCloth ()
| Creates the underlying Maya TnCloth and sets this class to wrap it.
MStatus | setTopology (const int numFaces, int *numVertsPerFace, int *faces, const int numEdges, int *edges)
| sets the topology of the underlying N Object.
MStatus | setPositions (const MFloatPointArray &positions, bool startFrame=true)
| Sets the positions of the vertices of the underlying N cloth object.
MStatus | setVelocities (const MFloatPointArray &velocities)
| Sets the velocities of the vertices of the underlying Ncloth object.
MStatus | setBendRestAngleFromPositions (const MFloatPointArray &positions)
| Sets the the bend rest angle from the list of positions for the underlying N Object This sets the shape that bend resistance is trying to achieve.
MStatus | setLinksRestLengthFromPositions (const MFloatPointArray &positions)
| Sets the the rest length from the list of positions for the underlying N Object.
MStatus | setInputMeshAttractPositions (const MFloatPointArray &positions)
| Sets the positions for input mesh attract.
MStatus | setInputMeshAttractDamping (float damping)
| Defines how springy the effect of Input Mesh Attract is.
MStatus | setInputMeshAttractAndRigidStrength (float *inputAttractArray, float *rigidArray, float *deformArray)
| Sets on a per particle basis, the amount by which each particle is affected by the input mesh attract, rigidity, and deformability.
MStatus | setComputeRestLength (const bool b)
| Sets whether rest lengths will be automatically computed, or overridden manually.
MStatus | setComputeRestAngles (const bool b)
| Sets whether rest angles will be automatically computed, or overridden manually.
MStatus | setThickness (float radius)
| sets a radius on each point of the mesh for collision purposes.
MStatus | setThickness (float *radius)
| sets a radius (thickness) on a per point basis for the mesh for collision purposes.
MStatus | setInverseMass (float invMass)
| sets the mass for every point in this mesh
MStatus | setInverseMass (float *invMass)
| sets the mass on a per point basis in this mesh
MStatus | setBounce (float bounce)
| sets the bounce for every point in this mesh
MStatus | setBounce (float *bounce)
| sets the bounce on a per point basis in this mesh
MStatus | setFriction (float friction)
| sets the friction for every point in this mesh
MStatus | setFriction (float *friction)
| sets the friction on a per point basis for this mesh
MStatus | setDamping (float damping)
| sets the damping for every point in this mesh
MStatus | setDamping (float *damping)
| sets the on a per point basis in this mesh
MStatus | setSelfCollisionFlags (const bool vertToVert, const bool vertToEdge=false, const bool vertToFace=false, const bool edgeToEdge=false, const bool edgeToFace=false)
| Sets how (or if) this object will collide with itself.
MStatus | setCollisionFlags (const bool vertToVert, const bool edgeToEdge=false, const bool faceToFace=false)
| Sets how (or if) this object will collide with other objects.
MStatus | setDisableGravity (const bool b)
| Sets whether gravity will affect this object.
MStatus | setMaxIterations (const int it)
| Sets the number of iterations the solver will perform on various dynamic properties like drag, damping, stretch and bend.
MStatus | setMaxSelfCollisionIterations (const int it)
| Sets the number of iterations the solver will perform for self collisions on this object.
MStatus | setSelfCollisionSoftness (float softness)
| This allows one to lower the repulsive force of self collisions such that some interpenetration within the collide width is allowed.
MStatus | setSelfTrappedCheck (bool on)
| This tracks self collision crossovers and attempts to push the crossed over points back.
MStatus | setSelfCrossoverPush (float val)
| See node documentation.
MStatus | setDragAndLift (float drag, float lift)
| Sets the drag and lift values for the cloth.
MStatus | setTangentialDrag (float tangentialDrag)
| Sets the tangential drag values for the cloth.
MStatus | setStartPressure (float startPressure)
| With the volume tracking pressure method this defines the relative air pressure inside the object at the startframe.
MStatus | setSealHoles (bool seal)
| When the volume tracking pressure method is used this determines if physical holes in the cloth model are treated as being capped or not.
MStatus | setPressure (float pressure)
| Sets the pressure within the cloth.
MStatus | setTrackVolume (bool track)
MStatus | setIncompressibility (float v)
| When the volume tracking pressure model is used this defines how incompressible the internal volume of fluid is.
MStatus | setPressureDamping (float damp)
| Sets the damping value for pressure.
MStatus | setPumpRate (float pump)
| Defines the rate at which air pressure is added to the object.
MStatus | setAirTightness (float airTightness)
| Defines the rate at which air can escape from the object, or how permiable the surface is.
MStatus | setAddCrossLinks (float addCrossLinks)
| For faces with more than 3 vertices this will create additional stretch and bends links such that each vertex is connected to each other vertex.
MStatus | setBendAngleDropoff (float dropoff)
| Defines the way bend resistance changes with the angle.
MStatus | setShearResistance (float resistance)
| Sets the shear resistance.
MStatus | setStretchAndCompressionResistance (float stretchResist, float compressionResist)
| Stretch Resistance:
MStatus | setStretchAndCompressionResistance (float *stretchResist, float *compressionResist)
| Sets the stretch and compression resistance for the mesh on a per vertex basis.
MStatus | setBendAngleScale (float scale)
| Defines the amount by which the rest state of the bend angle is scaled.
MStatus | setRestitutionAngle (float angle)
| Defines how far we can bend across an edge before it will fail to go back to the rest angle when there are no forces acting on the cloth.
MStatus | setRestitutionTension (float tension)
| How far can the links be stretched before they fail to go back to their rest length when there are no forces acting on the cloth.
MStatus | setSelfCollideWidth (float width)
| Sets the self collision width.
MStatus | setBendResistance (float strength)
| Bend resistance measures the amount of attraction to the restAngle, which is defined between cvs on either side of an edge.
MStatus | getNumVertices (unsigned int &numVerts) const
| Returns the number of vertices in the underlying n Cloth.
MStatus | getPositions (MFloatPointArray &positions) const
| gets the positions of the points of the underlying N Object.
MStatus | getVelocities (MFloatPointArray &velocities) const
| gets the velocities of the points of the underlying N cloth object.
MStatus | getThickness (MFloatArray &radius) const
| gets the thickness at each point of the underlying N cloth object.
MStatus | getInverseMass (MFloatArray &inverseMass) const
| gets the inverseMass at each point of the underlying N cloth object.
MStatus | getBounce (MFloatArray &bounce) const
| gets the bounce at each point of the underlying N cloth object.
MStatus | getFriction (MFloatArray &friction) const
| gets the friction at each point of the underlying N cloth object.
## Friends
class | MFnNObjectData Search for all occurrences

## Constructor & Destructor Documentation

MnCloth | ( |  | ) |

Default constructor.

The instance is set to contain nothing.

## Member Function Documentation

MStatus createNCloth | ( |  | ) |

Search for all occurrences

Creates the underlying Maya TnCloth and sets this class to wrap it.

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setTopology | ( | const int | numFaces,
|  | int * | numVertsPerFace,
|  | int * | faces,
|  | const int | numEdges,
|  | int * | edges
| ) |  |

Search for all occurrences

sets the topology of the underlying N Object.

Before calling other methods, this must be the first method you call once the cloth object is created.

Parameters:

  [in] | numFaces | number of faces
  [in] | numVertsPerFace | an array of size numFaces, where each element describes the number of verts on that face
  [in] | faces | an array containing the actual face description. Each element is a vertex index.
  [in] | numEdges | number of edges
  [in] | edges | an array containing the edge description. Each element is a vertex index.

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setPositions | ( | const MFloatPointArray & | positions,
|  | bool | startFrame = `true`
| ) |  |

Search for all occurrences

Sets the positions of the vertices of the underlying N cloth object.

Parameters:

  [in] | positions | the array containing the position information
  [in] | startFrame | whether this information represents the state of the object at the start frame.

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

Examples:
  testNucleusNode.cpp.

MStatus setVelocities | ( | const MFloatPointArray & | velocities | ) |

Search for all occurrences

Sets the velocities of the vertices of the underlying Ncloth object.

Parameters:

  [in] | velocities | the array containing the velocity information

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setBendRestAngleFromPositions | ( | const MFloatPointArray & | positions | ) |

Search for all occurrences

Sets the the bend rest angle from the list of positions for the underlying N Object This sets the shape that bend resistance is trying to achieve.

Parameters:

  [in] | positions | the array containing the position information

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setLinksRestLengthFromPositions | ( | const MFloatPointArray & | positions | ) |

Search for all occurrences

Sets the the rest length from the list of positions for the underlying N Object.

This sets the shape that the stretch/compression resistance are trying to achieve.

Parameters:

  [in] | positions | the array containing the position information

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setInputMeshAttractPositions | ( | const MFloatPointArray & | positions | ) |

Search for all occurrences

Sets the positions for input mesh attract.

Parameters:

  [in] | positions | the array containing the position information

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setInputMeshAttractDamping | ( | float | damping | ) |

Search for all occurrences

Defines how springy the effect of Input Mesh Attract is.

At a value of zero input mesh attract will behave like a spring connection from the input mesh to the output dynamic mesh. The cloth will tend to wiggle about the input mesh position. As the Input Attract Damp is increased to 1 the cloth mesh will still move to the input mesh position but not have the momentum to travel past it, so will no longer occillate about the input position.

Parameters:

  [in] | damping | the damping value

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setInputMeshAttractAndRigidStrength | ( | float * | inputAttractArray,
|  | float * | rigidArray,
|  | float * | deformArray
| ) |  |

Search for all occurrences

Sets on a per particle basis, the amount by which each particle is affected by the input mesh attract, rigidity, and deformability.

High values for the input mesh attract will make points stick closely to the input mesh. High values for the rigidArray will make the object behave like a rigid body.

These arguments actually encode 2 pieces of information in 1. It contains instructions for:

A) The number of iterations and B) The strength of the effect

The number of iterations is the maximum value over the array passed in. The relative strength, measured from 0 to 1, is the normalized value of each element of the array.

For example, if for the inputAttractArray one were to specify a value of 10.0 for the first element, and 1.0 for the rest, it means that the solver should take 10 steps to compute inputMeshAttract, and the first particle has a strength of 1 while the rest have a strength of 0.1.

Parameters:

  [in] | inputAttractArray | values for the input mesh attract
  [in] | rigidArray | values for rigidity
  [in] | deformArray | values for deformability

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setComputeRestLength | ( | const bool | b | ) |

Search for all occurrences

Sets whether rest lengths will be automatically computed, or overridden manually.

If this is set to false, then you must call setLinksRestLengthFromPositions() to set the rest lengths.

Parameters:

  [in] | b | whether to compute rest lengths

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setComputeRestAngles | ( | const bool | b | ) |

Search for all occurrences

Sets whether rest angles will be automatically computed, or overridden manually.

If this is set to false, then you must call setBendRestAngleFromPositions() to set the rest lengths.

Parameters:

  [in] | b | whether to compute rest angles

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setThickness | ( | float | radius | ) |

Search for all occurrences

sets a radius on each point of the mesh for collision purposes.

The bigger the radius/thickness, the more easily things collide.

Parameters:

  [in] | radius | the radius to set

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setThickness | ( | float * | radius | ) |

Search for all occurrences

sets a radius (thickness) on a per point basis for the mesh for collision purposes.

The bigger the radius, the more easily things collide.

Parameters:

  [in] | radius | the radius to set

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setInverseMass | ( | float | invMass | ) |

Search for all occurrences

sets the mass for every point in this mesh

Parameters:

  [in] | invMass | the inverse of the mass. A value of 0 means an infinitely heave object.

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setInverseMass | ( | float * | invMass | ) |

Search for all occurrences

sets the mass on a per point basis in this mesh

Parameters:

  [in] | invMass | the inverse of the mass. A value of 0 means an infinitely heave object.

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setBounce | ( | float | bounce | ) |

Search for all occurrences

sets the bounce for every point in this mesh

Parameters:

  [in] | bounce | value of bounce to set

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setBounce | ( | float * | bounce | ) |

Search for all occurrences

sets the bounce on a per point basis in this mesh

Parameters:

  [in] | bounce | value of bounce to set

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setFriction | ( | float | friction | ) |

Search for all occurrences

sets the friction for every point in this mesh

Parameters:

  [in] | friction | the friction to set

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setFriction | ( | float * | friction | ) |

Search for all occurrences

sets the friction on a per point basis for this mesh

Parameters:

  [in] | friction | the friction to set

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setDamping | ( | float | damping | ) |

Search for all occurrences

sets the damping for every point in this mesh

Parameters:

  [in] | damping | the damping value to set

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setDamping | ( | float * | damping | ) |

Search for all occurrences

sets the on a per point basis in this mesh

Parameters:

  [in] | damping | the damping value to set

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setSelfCollisionFlags | ( | const bool | vertToVert,
|  | const bool | vertToEdge = `false`,
|  | const bool | vertToFace = `false`,
|  | const bool | edgeToEdge = `false`,
|  | const bool | edgeToFace = `false`
| ) |  |

Search for all occurrences

Sets how (or if) this object will collide with itself.

Parameters:

  [in] | vertToVert | whether to calculate vertex - vertex collisions
  [in] | vertToEdge | whether to calculate vertex - edge collisions
  [in] | vertToFace | whether to calculate vertex - face collisions
  [in] | edgeToEdge | whether to calculate edge - edge collisions
  [in] | edgeToFace | whether to calculate edge - face collisions

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setCollisionFlags | ( | const bool | vertToVert,
|  | const bool | edgeToEdge = `false`,
|  | const bool | faceToFace = `false`
| ) |  |

Search for all occurrences

Sets how (or if) this object will collide with other objects.

Parameters:

  [in] | vertToVert | whether to calculate vertex - vertex collisions
  [in] | edgeToEdge | whether to calculate edge - edge collisions
  [in] | faceToFace | whether to calculate face - face collisions

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setDisableGravity | ( | const bool | b | ) |

Search for all occurrences

Sets whether gravity will affect this object.

Parameters:

  [in] | b | whether to calculate gravity

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setMaxIterations | ( | const int | it | ) |

Search for all occurrences

Sets the number of iterations the solver will perform on various dynamic properties like drag, damping, stretch and bend.

Higher iterations take longer, and the primary use of this attribute is to keep things from locking up should high iteration values be requested.

Parameters:

  [in] | it | number of iterations

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setMaxSelfCollisionIterations | ( | const int | it | ) |

Search for all occurrences

Sets the number of iterations the solver will perform for self collisions on this object.

Parameters:

  [in] | it | number of iterations

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setSelfCollisionSoftness | ( | float | softness | ) |

Search for all occurrences

This allows one to lower the repulsive force of self collisions such that some interpenetration within the collide width is allowed.

This can in some cases reduce jitter due to self collision with low selfCollideIterations. In general its use should be avoided, however.

Parameters:

  [in] | softness | value to set.

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setSelfTrappedCheck | ( | bool | on | ) |

Search for all occurrences

This tracks self collision crossovers and attempts to push the crossed over points back.

It assumes that the surface is in a good state at the start and attempts to preserve that relative state. It is useful in cases where cloth can get caught between passive objects than interpenetrate (for example an elbow passing through a chest). Rather than get stuck on the wrong side this allows the cloth to push back to the correct side when the passive objects later separate.

Parameters:

  [in] | on | whether to turn on self trapped check.

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setSelfCrossoverPush | ( | float | val | ) |

Search for all occurrences

See node documentation.

Parameters:

  [in] | val | value for crossover push

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setDragAndLift | ( | float | drag,
|  | float | lift
| ) |  |

Search for all occurrences

Sets the drag and lift values for the cloth.

Parameters:

  [in] | drag | value of drag
  [in] | lift | value of lift

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setTangentialDrag | ( | float | tangentialDrag | ) |

Search for all occurrences

Sets the tangential drag values for the cloth.

Defines the component of drag tangent to the surface. With a value of zero a flat plane will slice through air with no resistance and only have drag when moving along its normal axis. With a value of 1.0 the effect of drag will be equal in all directions.

Parameters:

  [in] | tangentialDrag | the tangential drag

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setStartPressure | ( | float | startPressure | ) |

Search for all occurrences

With the volume tracking pressure method this defines the relative air pressure inside the object at the startframe.

Parameters:

  [in] | startPressure | the start pressure

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setSealHoles | ( | bool | seal | ) |

Search for all occurrences

When the volume tracking pressure method is used this determines if physical holes in the cloth model are treated as being capped or not.

If holes are not sealed, then air can escape out them, which also has the effect of pushing the cloth. For example, this can simulate a rubber balloon that is suddenly released. It also allows for inflow based on motion of the cloth. The opening in a parachute will allow air to flow in as it falls down, causing sideways pressure that inflates it. Note that drag alone cannot achieve this sort of effect

Parameters:

  [in] | seal | whether to seal holes

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setPressure | ( | float | pressure | ) |

Search for all occurrences

Sets the pressure within the cloth.

This defines a force applied along the surface normal direction

Parameters:

  [in] | pressure | the value of pressure to set

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setTrackVolume | ( | bool | track | ) |

Search for all occurrences

Parameters:

  [in] | track | whether to track volume

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setIncompressibility | ( | float | v | ) |

Search for all occurrences

When the volume tracking pressure model is used this defines how incompressible the internal volume of fluid is.

This also will affect how much force is applied to the cloth when air is pumped in. In the case of a balloon higher values of incompressibility will overcome higher stretch resistance. Note that higher incompressibility may require more calculation time.

Parameters:

  [in] | v | how incompressible the cloth is

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setPressureDamping | ( | float | damp | ) |

Search for all occurrences

Sets the damping value for pressure.

Parameters:

  [in] | damp | value to set

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setPumpRate | ( | float | pump | ) |

Search for all occurrences

Defines the rate at which air pressure is added to the object.

Parameters:

  [in] | pump | value to set

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setAirTightness | ( | float | airTightness | ) |

Search for all occurrences

Defines the rate at which air can escape from the object, or how permiable the surface is.

This is in addition to any physical holes in the model, which can be be capped or not using the seal holes method.

Parameters:

  [in] | airTightness | value to set

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setAddCrossLinks | ( | float | addCrossLinks | ) |

Search for all occurrences

For faces with more than 3 vertices this will create additional stretch and bends links such that each vertex is connected to each other vertex.

If this is off then the links will exactly match the meshes list of edges. For a quad meshes having addCrossLinks off would allow the cloth to shear, unless shear resistance was used.

Parameters:

  [in] | addCrossLinks | value to set

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setBendAngleDropoff | ( | float | dropoff | ) |

Search for all occurrences

Defines the way bend resistance changes with the angle.

At higher values the bend will resist more at high angles then when the surface is nearly flat.

Parameters:

  [in] | dropoff | value to set

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setShearResistance | ( | float | resistance | ) |

Search for all occurrences

Sets the shear resistance.

Shear can be thought of as the bend in the plane of the cloth.

Parameters:

  [in] | resistance | value to set

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setStretchAndCompressionResistance | ( | float | stretchResist,
|  | float | compressionResist
| ) |  |

Search for all occurrences

Stretch Resistance:

Defines the amount that the material will resist stretching when under tension. Large values generally require more computation, so they may result in longer simulation times. Note that the scalingRelation attribute affects how this value is defined. Also one may need to additionally make the both collision iterations on the solver and constraint strength values high to keep stretching low.

Compression Resistance:

Defines the amount that the material will resist compression. Note that sometimes it is useful to have this value be lower than the Stretch Resistance, because the mesh resolution is only an approximation to a true surface, which could possibly fold within the length of a triangle. If one has a rest position for a cloth that is not flat and the compression and stretch resistance are both high then this can make cloth appear too stiff because the topology locks up. This problem is most noticable when the faces have relatively high angles relative to each other. Having a low compression resistance allows the material keep from locking up, yet still not appear to stretchy. Large values generally require more computation, so they may result in longer simulation times.

Parameters:

  [in] | stretchResist | value to set for stretch
  [in] | compressionResist | value to set for compression

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setStretchAndCompressionResistance | ( | float * | stretchResist,
|  | float * | compressionResist
| ) |  |

Search for all occurrences

Sets the stretch and compression resistance for the mesh on a per vertex basis.

Parameters:

  [in] | stretchResist | value to set for stretch
  [in] | compressionResist | value to set for compression

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setBendAngleScale | ( | float | scale | ) |

Search for all occurrences

Defines the amount by which the rest state of the bend angle is scaled.

Parameters:

  [in] | scale | value to set

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setRestitutionAngle | ( | float | angle | ) |

Search for all occurrences

Defines how far we can bend across an edge before it will fail to go back to the rest angle when there are no forces acting on the cloth.

Parameters:

  [in] | angle | value to set

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setRestitutionTension | ( | float | tension | ) |

Search for all occurrences

How far can the links be stretched before they fail to go back to their rest length when there are no forces acting on the cloth.

When the tension is greater than the defined value the defined rest length will increase until the tension is equal this value. For very low values the material will pull apart like taffy, yet still resist stretching under mild forces.

Parameters:

  [in] | tension | value to set

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setSelfCollideWidth | ( | float | width | ) |

Search for all occurrences

Sets the self collision width.

Parameters:

  [in] | width | value to set

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus setBendResistance | ( | float | strength | ) |

Search for all occurrences

Bend resistance measures the amount of attraction to the restAngle, which is defined between cvs on either side of an edge.

Larger values will tend to make the surface more rigid and will take longer to compute.

Parameters:

  [in] | strength | value to set

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus getNumVertices | ( | unsigned int & | numVerts | ) | const

Search for all occurrences

Returns the number of vertices in the underlying n Cloth.

Parameters:

  [out] | numVerts | Number of vertices.

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus getPositions | ( | MFloatPointArray & | positions | ) | const

Search for all occurrences

gets the positions of the points of the underlying N Object.

Parameters:

  [out] | positions | the array will be filled with the positions.

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

Examples:
  testNucleusNode.cpp.

MStatus getVelocities | ( | MFloatPointArray & | velocities | ) | const

Search for all occurrences

gets the velocities of the points of the underlying N cloth object.

Parameters:

  [in] | velocities | the array will be filled with the positions.

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus getThickness | ( | MFloatArray & | radius | ) | const

Search for all occurrences

gets the thickness at each point of the underlying N cloth object.

Parameters:

  [in] | radius | the array will be filled with the thickness.

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus getInverseMass | ( | MFloatArray & | inverseMass | ) | const

Search for all occurrences

gets the inverseMass at each point of the underlying N cloth object.

Parameters:

  [in] | inverseMass | the array will be filled with the inverse masses.

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus getBounce | ( | MFloatArray & | bounce | ) | const

Search for all occurrences

gets the bounce at each point of the underlying N cloth object.

Parameters:

  [in] | bounce | the array will be filled with the bounce.

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MStatus getFriction | ( | MFloatArray & | friction | ) | const

Search for all occurrences

gets the friction at each point of the underlying N cloth object.

Parameters:

  [in] | friction | the array will be filled with the friction.

Returns:
  - MS::kSuccess the operation was completed successfully
  - MS::kFailure the operation failed

MnCloth MnCloth MnCloth MnCloth MnCloth MnCloth MnCloth MnCloth MnCloth MnCloth
MnCloth MnCloth MnCloth MnCloth MnCloth MnCloth MnCloth MnCloth MnCloth MnCloth