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

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Member Functions

# MFnMatrixAttribute Class Reference
OpenMaya - API module for common classes | FunctionSet classes

Search for all occurrences

## Detailed Description

Matrix attribute function set.

Function object for matrix attributes. These attributes accept either a matrix of float values or double values depending on the type specified to the create method.

Examples:

  anisotropicShader.cpp, buildRotationNode.cpp, cellShader.cpp, cgfxAttrDef.cpp, cgfxVector.cpp, flameShader.cpp, GLSLShaderNode.cpp, lavaShader.cpp, noiseShader.cpp, offsetNode.cpp, slopeShaderNode.cpp, and solidCheckerShader.cpp.

`#include <MFnMatrixAttribute.h>`

Inheritance diagram for MFnMatrixAttribute:
[legend]

List of all members.

## Public Types
enum | Type { kFloat, kDouble }
| Matrix data type. More...
## Public Member Functions
virtual MFn::Type | type () const
| Function set type.
virtual | ~MFnMatrixAttribute ()
| Destructor.
| MFnMatrixAttribute ()
| Default constructor.
| MFnMatrixAttribute (MObject &object, MStatus *ReturnStatus=NULL)
| Constructor.
MObject | create (const MString &fullName, const MString &briefName, Type matrixType=kDouble, MStatus *ReturnStatus=NULL)
| Creates a matrix attribute object.
MStatus | getDefault (MMatrix &def)
| Gets the default value for the attribute.
MStatus | getDefault (MFloatMatrix &def)
| Gets the default value for the attribute.
MStatus | setDefault (const MMatrix &def)
| Sets the default value for the attribute.
MStatus | setDefault (const MFloatMatrix &def)
| Sets the default value for the attribute.
| MFnMatrixAttribute (const MObject &object, MStatus *ReturnStatus=NULL)
| Constructor.
## Protected Member Functions
virtual const char * | className () const
| Class name.

## Member Enumeration Documentation

enum Type

Search for all occurrences

Matrix data type.

Enumerator:

  kFloat | Matrix of float values. Search for all occurrences
  kDouble | Matrix of double values. Search for all occurrences

## Constructor & Destructor Documentation

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

MFnMatrixAttribute | ( | 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::kMatrixAttribute.

Reimplemented from MFnAttribute.

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

Search for all occurrences

Class name.

Return the class name : "MFnMatrixAttribute".

Reimplemented from MFnAttribute.

MObject create | ( | const MString & | fullName,
|  | const MString & | briefName,
|  | Type | matrixType = `kDouble`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Search for all occurrences

Creates a matrix attribute object.

The create method needs to be called on a per node basis. That means if you want to create and add the same attribute to multiple nodes, you need to call the create method for each node to get a unique MObject back. If you call create just once and add the attribute to multiple nodes, Maya will encounter a fatal error.

Parameters:

  [in] | fullName | The full name of the attribute
  [in] | briefName | The brief name of the attribute
  [in] | matrixType | Whether to create a matrix of floats or doubles
  [out] | ReturnStatus | Status code for the operation.

Returns:
  The newly created Matrix attribute object.

Status Codes:
  - MS::kSuccess The attribute object was successfully created.
  - MS::kInsufficientMemory There is no more memory

Examples:
  anisotropicShader.cpp, buildRotationNode.cpp, cellShader.cpp, cgfxAttrDef.cpp, cgfxVector.cpp, flameShader.cpp, GLSLShaderNode.cpp, lavaShader.cpp, noiseShader.cpp, offsetNode.cpp, slopeShaderNode.cpp, and solidCheckerShader.cpp.

MStatus getDefault | ( | MMatrix & | def | ) |

Search for all occurrences

Gets the default value for the attribute.

Use this for getting the default value of a double matrix attribute.

Parameters:

  [out] | def | returns the default matrix value

Returns:
  Status flag

Status Codes:
  - MS::kSuccess The defaults were successfully queried
  - MS::kFailure Function set does not have a valid object

MStatus getDefault | ( | MFloatMatrix & | def | ) |

Search for all occurrences

Gets the default value for the attribute.

Use this for getting the default value of a float matrix attribute.

Parameters:

  [out] | def | returns the default matrix value

Returns:
  Status flag

Status Codes:
  - MS::kSuccess The defaults were successfully queried
  - MS::kFailure Function set does not have a valid object

MStatus setDefault | ( | const MMatrix & | def | ) |

Search for all occurrences

Sets the default value for the attribute.

Use this for setting the defaults of a double matrix attribute.

Parameters:

  [in] | def | matrix value

Returns:
  Status flag

Status Codes:
  - MS::kSuccess The defaults were successfully set
  - MS::kFailure Function set does not have a valid object

MStatus setDefault | ( | const MFloatMatrix & | def | ) |

Search for all occurrences

Sets the default value for the attribute.

Use this for setting the defaults of a float matrix attribute.

Parameters:

  [in] | def | matrix value

Returns:
  Status flag

Status Codes:
  - MS::kSuccess The defaults were successfully set
  - MS::kFailure Function set does not have a valid object

MFnMatrixAttribute MFnMatrixAttribute MFnMatrixAttribute MFnMatrixAttribute MFnMatrixAttribute MFnMatrixAttribute MFnMatrixAttribute MFnMatrixAttribute MFnMatrixAttribute MFnMatrixAttribute
MFnMatrixAttribute MFnMatrixAttribute MFnMatrixAttribute MFnMatrixAttribute MFnMatrixAttribute MFnMatrixAttribute MFnMatrixAttribute MFnMatrixAttribute MFnMatrixAttribute MFnMatrixAttribute