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

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions

# MFnAirField Class Reference
OpenMayaFX - API module for effects | FunctionSet classes

Search for all occurrences

## Detailed Description

Function set for Air Fields.

Function set for creation, edit, and query of Air Fields.

An air field simulates the effects of moving air.

`#include <MFnAirField.h>`

Inheritance diagram for MFnAirField:
[legend]

List of all members.

## Public Member Functions
virtual MFn::Type | type () const
| Function set type.
virtual | ~MFnAirField ()
| Destructor.
| MFnAirField ()
| Default constructor.
| MFnAirField (MObject &object, MStatus *ReturnStatus=NULL)
| Constructor.
| MFnAirField (const MDagPath &object, MStatus *ret=NULL)
| Constructor.
MVector | direction (MStatus *ReturnStatus=NULL) const
| Returns the direction the air is blowing.
MStatus | setDirection (const MVector &airDirection)
| Sets the direction vector for the air to blow.
double | speed (MStatus *ReturnStatus=NULL) const
| Returns the control setting on how quickly objects match the velocity of the air field.
MStatus | setSpeed (double value)
| Sets the control setting on how quickly the objects match the velocity of the air field.
double | inheritVelocity (MStatus *ReturnStatus=NULL) const
| Returns the amount of the moving air field's velocity that is added to the direction and magnitude of the wind.
MStatus | setInheritVelocity (double velocity)
| Sets the amount of the moving air field's velocity that is added to the direction and magnitude of the wind.
bool | inheritRotation (MStatus *ReturnStatus=NULL) const
| Returns true if the air field is rotating or parented to a rotating object, and will undergo that same rotation.
MStatus | setInheritRotation (bool enable)
| Enables the air field to undergo rotations and effect the direction that the air field points.
bool | componentOnly (MStatus *ReturnStatus=NULL) const
| Returns true if the air field will apply force only in the direction specified by the combination of its direction, speed, and inherit velocity attributes.
MStatus | setComponentOnly (bool enable)
| Enables the air field to apply force specified as a combination of its direction, speed, and inherit veloicty attributes.
double | spread (MStatus *ReturnStatus=NULL) const
| Returns a value that represents an angle which objects are affected by the air fields direction setting.
MStatus | setSpread (double value)
| Sets the value representing an angle which objects are affected by the air fields direction setting.
bool | enableSpread (MStatus *ReturnStatus=NULL) const
| Returns true if the air field is using the spread angle to define the influence of the air field.
MStatus | setEnableSpread (bool enable)
| Enables the air field to influence objects based on the spread angle setting.
| MFnAirField (const MObject &object, MStatus *ret=NULL)
| Constructor.
## Protected Member Functions
virtual const char * | className () const
| Class name. Search for all occurrences

## Constructor & Destructor Documentation

~MFnAirField | ( |  | ) | `[virtual]`

Destructor.

Class destructor.

MFnAirField | ( | 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

MFnAirField | ( | const MDagPath & | object,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Constructor.

Class constructor that initializes the function set to the given constant MDagPath object.

Parameters:

  [in] | object | The const MDagPath 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

MFnAirField | ( | 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

## Member Function Documentation

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

Search for all occurrences

Function set type.

Return the class type : MFn::kAir.

Reimplemented from MFnField.

MVector direction | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the direction the air is blowing.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  A vector representing direction.

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MStatus setDirection | ( | const MVector & | airDirection | ) |

Search for all occurrences

Sets the direction vector for the air to blow.

Parameters:

  [in] | airDirection | A vector representing direction.

Returns:
  Status code

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

double speed | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the control setting on how quickly objects match the velocity of the air field.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  The value of the speed setting.

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MStatus setSpeed | ( | double | value | ) |

Search for all occurrences

Sets the control setting on how quickly the objects match the velocity of the air field.

Parameters:

  [in] | value | A value representing speed. A value of 0 is equivalent of turning the air field off. A value of 1 and objects will match the velocity almost instantaneously.

Returns:
  Status code

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

double inheritVelocity | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the amount of the moving air field's velocity that is added to the direction and magnitude of the wind.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  A value from 0 to 1 representing the amount of velocity added.

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MStatus setInheritVelocity | ( | double | velocity | ) |

Search for all occurrences

Sets the amount of the moving air field's velocity that is added to the direction and magnitude of the wind.

Parameters:

  [in] | velocity | A value from 0 to 1 representing the amount of velocity that is added.

Returns:
  Status code

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

bool inheritRotation | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns true if the air field is rotating or parented to a rotating object, and will undergo that same rotation.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  - true Rotations will change the direction the air field points.
  - false Rotations do not change the air field direction.

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MStatus setInheritRotation | ( | bool | enable | ) |

Search for all occurrences

Enables the air field to undergo rotations and effect the direction that the air field points.

Parameters:

  [in] | enable | Flag to enable or disable rotations effects.

Returns:
  Status code

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

bool componentOnly | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns true if the air field will apply force only in the direction specified by the combination of its direction, speed, and inherit velocity attributes.

Returns false if the force is made to effect the object's velocity to match the air field's velocity.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  - true Force applied only in direction of attributes.
  - false Force applied to match velocities.

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MStatus setComponentOnly | ( | bool | enable | ) |

Search for all occurrences

Enables the air field to apply force specified as a combination of its direction, speed, and inherit veloicty attributes.

Parameters:

  [in] | enable | Flag to enable or disable combination of attributes.

Returns:
  Status code

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

double spread | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns a value that represents an angle which objects are affected by the air fields direction setting.

This value is taken into account when the Enable Spread attribute is turned on.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  - A value from 0 to 1 representing an angle.
  - A value of 0 effects objects only exactly in front of the direction vector.
  - A value of 1 effects objects in front by 180 degrees along the direction vector.

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MStatus setSpread | ( | double | value | ) |

Search for all occurrences

Sets the value representing an angle which objects are affected by the air fields direction setting.

This value is taken into account when the Enable Spread attribute is turned on.

Parameters:

  [in] | value | A value representing an angle. A value of 0 effects objects only exactly in front of the direction vector. A value of 1 effects objects in front by 180 degrees along the direction vector.

Returns:
  Status code

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

bool enableSpread | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns true if the air field is using the spread angle to define the influence of the air field.

Parameters:

  [out] | ReturnStatus | Status code

Returns:
  - true Objects are affected in the area of the spread angle.
  - false Objects are affected by the max distance setting.

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MStatus setEnableSpread | ( | bool | enable | ) |

Search for all occurrences

Enables the air field to influence objects based on the spread angle setting.

Parameters:

  [in] | enable | Flag to enable or disable use of the spread angle.

Returns:
  Status code

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MFnAirField MFnAirField MFnAirField MFnAirField MFnAirField MFnAirField MFnAirField MFnAirField MFnAirField MFnAirField
MFnAirField MFnAirField MFnAirField MFnAirField MFnAirField MFnAirField MFnAirField MFnAirField MFnAirField MFnAirField