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

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Member Functions

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

Search for all occurrences

## Detailed Description

Manage Spot Light dependency Nodes.

MFnSpotLight facilitates creation and manipulation of dependency graph nodes representing spotlights.

Examples:

  D3DResourceManager.cpp, and intersectCmd.cpp.

`#include <MFnSpotLight.h>`

Inheritance diagram for MFnSpotLight:
[legend]

List of all members.

## Public Types
enum | MBarnDoor { kLeft, kRight, kTop, kBottom }
| Available doors for barnDoor-related methods. More...
enum | MDecayRegion { kFirst, kSecond, kThird }
| Decay regions. More...
## Public Member Functions
virtual MFn::Type | type () const
| Function set type.
virtual | ~MFnSpotLight ()
| Destructor.
| MFnSpotLight ()
| Default constructor.
| MFnSpotLight (MObject &object, MStatus *ReturnStatus=NULL)
| Constructor.
| MFnSpotLight (const MDagPath &object, MStatus *ret=NULL)
| Constructor.
MObject | create (bool UIvisible=true, MStatus *ReturnStatus=NULL)
| Creates a new spotlight dependency graph node and adds it to the dependency graph.
MObject | create (const MObject &parent, bool UIvisible=true, bool wantTransform=false, MStatus *ReturnStatus=NULL)
| Creates a new spotlight dependency graph node and adds it to the dependency graph.
double | coneAngle (MStatus *ReturnStatus=NULL) const
| Retrieves the value of the "coneAngle" attribute of a light node.
MStatus | setConeAngle (const double &coneAngle)
| Sets the value of the "coneAngle" attribute of a light node.
double | penumbraAngle (MStatus *ReturnStatus=NULL) const
| Retrieves the value of the "penumbraAngle" attribute of a light node.
MStatus | setPenumbraAngle (const double &penumbraAngle)
| Sets the value of the "penumbraAngle" attribute of a light node.
double | dropOff (MStatus *ReturnStatus=NULL) const
| Retrieves the value of the "dropOff" attribute of a light node.
MStatus | setDropOff (const double &dropOff)
| Sets the value of the "dropOff" attribute of a light node.
bool | barnDoors (MStatus *ReturnStatus=NULL) const
| Retrieves the value of the "barnDoors" attribute of a light node.
MStatus | setBarnDoors (const bool &barnDoors)
| Sets the value of the "barnDoors" attribute of a light node.
double | barnDoorAngle (MBarnDoor which_door, MStatus *ReturnStatus=NULL) const
| Retrieves the value of the barn door angle for the specified barn door.
MStatus | setBarnDoorAngle (MBarnDoor which_door, const double &barn_door_angle)
| Sets the value of the appropriate barn door angle attribute of a light node.
bool | useDecayRegions (MStatus *ReturnStatus=NULL) const
| Retrieves the value of the "useDecayRegions" attribute of a light node.
MStatus | setUseDecayRegions (const bool &use_decay_regions)
| Sets the value of the "useDecayRegions" attribute of a light node.
float | startDistance (MDecayRegion which_region, MStatus *ReturnStatus=NULL) const
| Retrieves the value of the start distance for the specified decay regions.
MStatus | setStartDistance (MDecayRegion which_region, const float &start_distance)
| Sets the value of the appropriate decay region start distance attribute of a light node.
float | endDistance (MDecayRegion which_region, MStatus *ReturnStatus=NULL) const
| Retrieves the value of the end distance for the specified decay regions.
MStatus | setEndDistance (MDecayRegion which_region, const float &end_distance)
| Sets the value of the appropriate decay region end distance attribute of a light node.
| MFnSpotLight (const MObject &object, MStatus *ret=NULL)
| Constructor.
MObject | create (const MObject &parent, bool UIvisible=true, MStatus *ReturnStatus=NULL)
| NO SCRIPT SUPPORT.
## Protected Member Functions
virtual const char * | className () const
| Class name.

## Member Enumeration Documentation

enum MBarnDoor

Search for all occurrences

Available doors for barnDoor-related methods.

Enumerator:

  kLeft | Search for all occurrences
  kRight | Search for all occurrences
  kTop | Search for all occurrences
  kBottom | Search for all occurrences

enum MDecayRegion

Search for all occurrences

Decay regions.

Enumerator:

  kFirst | Search for all occurrences
  kSecond | Search for all occurrences
  kThird | Search for all occurrences

## Constructor & Destructor Documentation

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

Destructor.

The class destructor.

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

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

MFnSpotLight | ( | 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::kSpotLight.

Reimplemented from MFnNonExtendedLight.

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

Search for all occurrences

Class name.

Return the class name : "MFnSpotLight".

Reimplemented from MFnNonExtendedLight.

MObject create | ( | bool | UIvisible = `true`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Search for all occurrences

Creates a new spotlight dependency graph node and adds it to the dependency graph.

If the UIvisible parameter is true, the new node will be connected to the light classification node (which allows the UI to recognize the node as a light) and added to the default light list. If UIvisible is false, the node will be created in isolation.

The light node is added to the current model, under a new transformation.

Parameters:

  [in] | UIvisible | determines whether or not to connect the new node to the light classification node and add it to the default light list.
  [out] | ReturnStatus | return status

Returns:
  MObject representing the new dependency node.

Status Codes:
  - MS::kSuccess operation successful
  - MS::kInsufficientMemory ran out of memory
  - MS::kNoModelActive no model is currently active
  - MS::kLicenseFailure application not licensed for attempted operation
  - MS::kFailure the new node could not be added to the model, or the function set could not be properly initialized with the new object.

MObject create | ( | const MObject & | parent,
|  | bool | UIvisible = `true`,
|  | bool | wantTransform = `false`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Search for all occurrences

Creates a new spotlight dependency graph node and adds it to the dependency graph.

If the UIvisible parameter is true, the new node will be connected to the light classification node (which allows the UI to recognize the node as a light) and added to the default light list. If UIvisible is false, the node will be created in isolation.

If wantTransform parameter is false ( which is by default ), the new shape node is created under the specified parent and no transform node is created. If the specified parent is null, then no shape node will be created.

The light node is added to the current model, under the specified parent.

Parameters:

  [in] | parent | the node under which the new light and its transform will be added.
  [in] | wantTransform | Boolean to indicate whether the transform node is needed or not, which is 'false' by default.
  [in] | UIvisible | determines whether or not to connect the new node to the light classification node and add it to the default light list.
  [out] | ReturnStatus | return status

Returns:
  MObject representing the new dependency node.

Status Codes:
  - MS::kSuccess operation successful
  - MS::kInsufficientMemory ran out of memory
  - MS::kNoModelActive no model is currently active
  - MS::kLicenseFailure application not licensed for attempted operation
  - MS::kFailure the new node could not be added to the model, or the function set could not be properly initialized with the new object.

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

Search for all occurrences

Retrieves the value of the "coneAngle" attribute of a light node.

This attribute represents the angle that the spotlight cone makes with the spotlight direction vector.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  The value of the "coneAngle" attribute of the light node.

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set doesn not have a valid object.

MStatus setConeAngle | ( | const double & | cone_angle | ) |

Search for all occurrences

Sets the value of the "coneAngle" attribute of a light node.

Parameters:

  [in] | cone_angle | value to which the attribute will be set.

Returns:
  Return status

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set doesn not have a valid object,

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

Search for all occurrences

Retrieves the value of the "penumbraAngle" attribute of a light node.

This attribute represents the extra angle beyond the cone angle used in soft shadow computations.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  The value of the "penumbraAngle" attribute of the light node.

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set doesn not have a valid object.

MStatus setPenumbraAngle | ( | const double & | penumbra_angle | ) |

Search for all occurrences

Sets the value of the "penumbraAngle" attribute of a light node.

Parameters:

  [in] | penumbra_angle | value to which the attribute will be set.

Returns:
  Return status

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set doesn not have a valid object.

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

Search for all occurrences

Retrieves the value of the "dropOff" attribute of a light node.

This attribute represents the degree to which intensity of the light decreases with increasing angular distance from the light direction vector. Higher values represent more rapid intensity dropoff.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  The value of the "dropOff" attribute of the light node.

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set doesn not have a valid object.

MStatus setDropOff | ( | const double & | drop_off | ) |

Search for all occurrences

Sets the value of the "dropOff" attribute of a light node.

Parameters:

  [in] | drop_off | value to which the attribute will be set.

Returns:
  Return status

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set doesn not have a valid object.

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

Search for all occurrences

Retrieves the value of the "barnDoors" attribute of a light node.

This attribute determines whether or not the light uses barn doors.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  The value of the "barnDoors" attribute of the light node.

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set does not have a valid object.

MStatus setBarnDoors | ( | const bool & | barn_doors | ) |

Search for all occurrences

Sets the value of the "barnDoors" attribute of a light node.

Parameters:

  [in] | barn_doors | value to which the attribute will be set.

Returns:
  Return status

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set does not have a valid object,

double barnDoorAngle | ( | MBarnDoor | which_door,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

Retrieves the value of the barn door angle for the specified barn door.

The barn door angles are represented by the "leftBarnDoor", "rightBarnDoor", "topBarnDoor", and "bottomBarnDoor" attributes. This function retrieves the value of the appropriate attribute.

Parameters:

  [in] | which_door | which barn door to return.
  [out] | ReturnStatus | return status

Returns:
  The value of the appropriate barn door angle attribute of the light node.

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set does not have a valid object, or the specified barn door was invalid.

MStatus setBarnDoorAngle | ( | MBarnDoor | which_door,
|  | const double & | barn_door_angle
| ) |  |

Search for all occurrences

Sets the value of the appropriate barn door angle attribute of a light node.

Parameters:

  [in] | which_door | Which barn door to return.
  [in] | barn_door_angle | New value for the barn door.

Returns:
  Return status

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set does not have a valid object, or the specified barn door was invalid.

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

Search for all occurrences

Retrieves the value of the "useDecayRegions" attribute of a light node.

This attribute determines whether or not the light uses decay regions.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  The value of the "useDecayRegions" attribute of the light node.

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set does not have a valid object.

MStatus setUseDecayRegions | ( | const bool & | use_decay_regions | ) |

Search for all occurrences

Sets the value of the "useDecayRegions" attribute of a light node.

Parameters:

  [in] | use_decay_regions | value to which the attribute will be set.

Returns:
  Return status

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set does not have a valid object,

float startDistance | ( | MDecayRegion | which_region,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

Retrieves the value of the start distance for the specified decay regions.

The start distances for the spotlight's 3 decay regions are represented by the "startDistance1", "startDistance2", and "startDistance3" attributes. This function retrieves the value of the appropriate attribute.

Parameters:

  [in] | which_region | the decay region whose startDistance attribute is to be retrieved.
  [out] | ReturnStatus | return status

Returns:
  The value of the appropriate startDistance attribute of the light node.

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set doesn not have a valid object, or the specified decay region was invalid.

MStatus setStartDistance | ( | MDecayRegion | which_region,
|  | const float & | start_distance
| ) |  |

Search for all occurrences

Sets the value of the appropriate decay region start distance attribute of a light node.

Parameters:

  [in] | which_region | the decay region whose start distance is to be set.
  [in] | start_distance | value to which the attribute will be set.

Returns:
  Return status

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set does not have a valid object, or the specified decay region was invalid.

float endDistance | ( | MDecayRegion | which_region,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

Retrieves the value of the end distance for the specified decay regions.

The end distances for the spotlight's 3 decay regions are represented by the "endDistance1", "endDistance2", and "endDistance3" attributes. This function retrieves the value of the appropriate attribute.

Parameters:

  [in] | which_region | the decay region whose endDistance attribute is to be retrieved.
  [out] | ReturnStatus | return status

Returns:
  The value of the appropriate endDistance attribute of the light node.

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set doesn not have a valid object, or the specified decay region was invalid.

MStatus setEndDistance | ( | MDecayRegion | which_region,
|  | const float & | end_distance
| ) |  |

Search for all occurrences

Sets the value of the appropriate decay region end distance attribute of a light node.

Parameters:

  [in] | which_region | the decay region whose end distance is to be set.
  [in] | end_distance | value to which the attribute will be set.

Returns:
  Return status

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure function set does not have a valid object, or the specified decay region was invalid.

MObject create | ( | const MObject & | parent,
|  | bool | UIvisible = `true`,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Search for all occurrences

NO SCRIPT SUPPORT.

Creates a new spotlight dependency graph node and adds it to the dependency graph.

If the UIvisible parameter is true, the new node will be connected to the light classification node (which allows the UI to recognize the node as a light) and added to the default light list. If UIvisible is false, the node will be created in isolation.

The light node is added to the current model, under a new transformation. The transformation is added to the current model under the specified parent.

Parameters:

  [in] | parent | the node under which the new light and its transform will be added.
  [in] | UIvisible | determines whether or not to connect the new node to the light classification node and add it to the default light list.
  [out] | ReturnStatus | return status

Returns:
  MObject representing the new dependency node.

Status Codes:
  - MS::kSuccess operation successful
  - MS::kInsufficientMemory ran out of memory
  - MS::kNoModelActive no model is currently active
  - MS::kLicenseFailure application not licensed for attempted operation
  - MS::kFailure the new node could not be added to the model, or the function set could not be properly initialized with the new object.

MFnSpotLight MFnSpotLight MFnSpotLight MFnSpotLight MFnSpotLight MFnSpotLight MFnSpotLight MFnSpotLight MFnSpotLight MFnSpotLight
MFnSpotLight MFnSpotLight MFnSpotLight MFnSpotLight MFnSpotLight MFnSpotLight MFnSpotLight MFnSpotLight MFnSpotLight MFnSpotLight