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

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions

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

Search for all occurrences

## Detailed Description

Light data attribute function set.

Function object for LightData attributes. A LightData attribute describes a single light source, giving its direction and intensity, as well as specifying whether or not it contributes to the ambient, diffuse, and specular components of the shading model.

Examples:

  anisotropicShader.cpp, backfillShader.cpp, lambertShader.cpp, lightShader.cpp, phongShader.cpp, and shadowMatteShader.cpp.

`#include <MFnLightDataAttribute.h>`

Inheritance diagram for MFnLightDataAttribute:
[legend]

List of all members.

## Public Member Functions
virtual MFn::Type | type () const
| Function set type.
virtual | ~MFnLightDataAttribute ()
| Destructor.
| MFnLightDataAttribute ()
| Default constructor.
| MFnLightDataAttribute (MObject &object, MStatus *ReturnStatus=NULL)
| Constructor.
MObject | create (const MString &fullName, const MString &briefName, const MObject &direction, const MObject &intensity, const MObject &ambient, const MObject &diffuse, const MObject &specular, const MObject &shadowFraciton, const MObject &preShadowIntensity, const MObject &blindData, MStatus *ReturnStatus=NULL)
| Creates a LightData attribute object.
MStatus | getDefault (float &defDirectionX, float &defDirectionY, float &defDirectionZ, float &defIntensityR, float &defIntensityG, float &defIntensityB, bool &defAmbient, bool &defDiffuse, bool &defSpecular, float &defShadowFraction, float &defPreShadowIntensity, void *&defBlindData)
| Gets the default value for the attribute.
MStatus | setDefault (float defDirectionX, float defDirectionY, float defDirectionZ, float defIntensityR, float defIntensityG, float defIntensityB, bool defAmbient, bool defDiffuse, bool defSpecular, float defShadowFraction, float defPreShadowIntensity, void *defBlindData)
| Sets the default value for the attribute.
MObject | child (unsigned int index, MStatus *returnStatus)
| Gets a pointer to one of the child attributes.
| MFnLightDataAttribute (const MObject &object, MStatus *ReturnStatus=NULL)
| Constructor.
## Protected Member Functions
virtual const char * | className () const
| Class name.

## Constructor & Destructor Documentation

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

MFnLightDataAttribute | ( | 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::kLightDataAttribute.

Reimplemented from MFnAttribute.

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

Search for all occurrences

Class name.

Return the class name : "MFnLightDataAttribute".

Reimplemented from MFnAttribute.

MObject create | ( | const MString & | fullName,
|  | const MString & | briefName,
|  | const MObject & | direction,
|  | const MObject & | intensity,
|  | const MObject & | ambient,
|  | const MObject & | diffuse,
|  | const MObject & | specular,
|  | const MObject & | shadowFraction,
|  | const MObject & | preShadowIntensity,
|  | const MObject & | blindData,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Search for all occurrences

Creates a LightData 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] | direction | The 3Float child attribute that will represent the light direction
  [in] | intensity | The 3Float child attibute that will represent the light intensity
  [in] | ambient | The Boolean child attribute that specifies whether or not the light contributes to the ambient component of the shading model
  [in] | diffuse | The Boolean child attribute that specifies whether or not the light contributes to the diffuse component of the shading model
  [in] | specular | The Boolean child attribute that specifies whether or not the light contributes to the specular component of the shading model
  [in] | shadowFraction | The float attribute that will represent the percentage of the light that is in shadow with respect to the intersection point. 0 means the light is total visible to the intersection point and 1 means the light is total invisible to the intersection point.
  [in] | preShadowIntensity | The float attribute that will represetnt the light intensity without shadow consideration
  [in] | blindData | Attribute to hold the light's blind data.
  [out] | ReturnStatus | Status code for the operation.

Returns:
  The newly created LightData attribute object.

Status Codes:
  - MS::kInvalidParameter One of the specified child attribute pointers was NULL or was of the wrong type
  - MS::kSuccess The attribute object was successfully created.

Examples:
  anisotropicShader.cpp, backfillShader.cpp, lambertShader.cpp, lightShader.cpp, phongShader.cpp, and shadowMatteShader.cpp.

MStatus getDefault | ( | float & | defDirectionX,
|  | float & | defDirectionY,
|  | float & | defDirectionZ,
|  | float & | defIntensityR,
|  | float & | defIntensityG,
|  | float & | defIntensityB,
|  | bool & | defAmbient,
|  | bool & | defDiffuse,
|  | bool & | defSpecular,
|  | float & | defShadowFraction,
|  | float & | defPreShadowIntensity,
|  | void *& | defBlindData
| ) |  |

Search for all occurrences

Gets the default value for the attribute.

Parameters:

  [out] | defDirectionX | returns the default x component of light direction
  [out] | defDirectionY | returns the default y component of light direction
  [out] | defDirectionZ | returns the default z component of light direction
  [out] | defIntensityR | returns the default red component of light intensity
  [out] | defIntensityG | returns the default green component of light intensity
  [out] | defIntensityB | returns the default blue component of light intensity
  [out] | defAmbient | returns the default ambient flag
  [out] | defDiffuse | returns the default diffuse flag
  [out] | defSpecular | returns the default specular flag
  [out] | defShadowFraction | returns the default shadow fraction flag
  [out] | defPreShadowIntensity | returns the default pre shadow intensity flag
  [out] | defBlindData | returns the default blind data

Returns:
  Status flag

Status Codes:
  - MS::kSuccess The defaults were successfully queried

MStatus setDefault | ( | float | defDirectionX,
|  | float | defDirectionY,
|  | float | defDirectionZ,
|  | float | defIntensityR,
|  | float | defIntensityG,
|  | float | defIntensityB,
|  | bool | defAmbient,
|  | bool | defDiffuse,
|  | bool | defSpecular,
|  | float | defShadowFraction,
|  | float | defPreShadowIntensity,
|  | void * | defBlindData
| ) |  |

Search for all occurrences

Sets the default value for the attribute.

Parameters:

  [in] | defDirectionX | Default x component of light direction
  [in] | defDirectionY | Default y component of light direction
  [in] | defDirectionZ | Default z component of light direction
  [in] | defIntensityR | Default red component of light intensity
  [in] | defIntensityG | Default green component of light intensity
  [in] | defIntensityB | Default blue component of light intensity
  [in] | defAmbient | Default ambient flag
  [in] | defDiffuse | Default diffuse flag
  [in] | defSpecular | Default specular flag
  [in] | defShadowFraction | Default shadow fraction flag
  [in] | defPreShadowIntensity | Default pre shadow intensity flag
  [in] | defBlindData | Default blind data

Returns:
  Status flag

Status Codes:
  - MS::kSuccess The defaults were successfully set

Examples:
  anisotropicShader.cpp, backfillShader.cpp, lambertShader.cpp, lightShader.cpp, phongShader.cpp, and shadowMatteShader.cpp.

MObject child | ( | unsigned int | index,
|  | MStatus * | ReturnStatus
| ) |  |

Search for all occurrences

Gets a pointer to one of the child attributes.

Parameters:

  [in] | index | Specifies which child is desired: 0 = direction 1 = intensity 2 = ambient flag 3 = diffuse flag 4 = specular flag 5 = shadow fraction flag 6 = pre shadow intensity flag 7 = blind data flag
  [out] | ReturnStatus | Status code for the operation

Returns:
  A pointer to the desired child attribute

Status Codes:
  - MS::kSuccess The child was successfully retrieved
  - MS::kFailure The child was not successfully retrieved

MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute
MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute