MFnSpotLight Class Reference
[OpenMaya - API module for common classesFunctionSet classes]

#include <MFnSpotLight.h>
Inheritance diagram for MFnSpotLight:
Inheritance graph
[legend]
Collaboration diagram for MFnSpotLight:
Collaboration graph
[legend]

List of all members.


Detailed Description

Manage Spot Light dependency Nodes.

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

Examples:

D3DResourceManager.cpp, and intersectCmd.cpp.


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)
MObject  create (const MObject &parent, bool UIvisible=true, bool wantTransform=false, MStatus *ReturnStatus=NULL)
double  coneAngle (MStatus *ReturnStatus=NULL) const
MStatus  setConeAngle (const double &coneAngle)
double  penumbraAngle (MStatus *ReturnStatus=NULL) const
MStatus  setPenumbraAngle (const double &penumbraAngle)
double  dropOff (MStatus *ReturnStatus=NULL) const
MStatus  setDropOff (const double &dropOff)
bool  barnDoors (MStatus *ReturnStatus=NULL) const
MStatus  setBarnDoors (const bool &barnDoors)
double  barnDoorAngle (MBarnDoor which_door, MStatus *ReturnStatus=NULL) const
MStatus  setBarnDoorAngle (MBarnDoor which_door, const double &barn_door_angle)
bool  useDecayRegions (MStatus *ReturnStatus=NULL) const
MStatus  setUseDecayRegions (const bool &use_decay_regions)
float  startDistance (MDecayRegion which_region, MStatus *ReturnStatus=NULL) const
MStatus  setStartDistance (MDecayRegion which_region, const float &start_distance)
float  endDistance (MDecayRegion which_region, MStatus *ReturnStatus=NULL) const
MStatus  setEndDistance (MDecayRegion which_region, const float &end_distance)
  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

Available doors for barnDoor-related methods.

Enumerator:
kLeft   
kRight   
kTop   
kBottom   

Decay regions.

Enumerator:
kFirst   
kSecond   
kThird   

Constructor & Destructor Documentation

MFnSpotLight::~MFnSpotLight (  )  [virtual]

Destructor.

The class destructor.

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

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

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

Member Function Documentation

MFn::Type MFnSpotLight::type (  )  const [virtual]

Function set type.

Return the class type : MFn::kSpotLight

Reimplemented from MFnNonExtendedLight.

const char * MFnSpotLight::className (  )  const [protected, virtual]

Class name.

Return the class name : "MFnSpotLight"

Reimplemented from MFnNonExtendedLight.

MObject MFnSpotLight::create ( bool  UIvisible = true,
MStatus ReturnStatus = NULL  
)

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:

MObject MFnSpotLight::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. 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:

double MFnSpotLight::coneAngle ( MStatus ReturnStatus = NULL  )  const

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:

MStatus MFnSpotLight::setConeAngle ( const double &  cone_angle  ) 

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:

double MFnSpotLight::penumbraAngle ( MStatus ReturnStatus = NULL  )  const

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:

MStatus MFnSpotLight::setPenumbraAngle ( const double &  penumbra_angle  ) 

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:

double MFnSpotLight::dropOff ( MStatus ReturnStatus = NULL  )  const

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:

MStatus MFnSpotLight::setDropOff ( const double &  drop_off  ) 

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:

bool MFnSpotLight::barnDoors ( MStatus ReturnStatus = NULL  )  const

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:

MStatus MFnSpotLight::setBarnDoors ( const bool &  barn_doors  ) 

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:

double MFnSpotLight::barnDoorAngle ( MBarnDoor  which_door,
MStatus ReturnStatus = NULL  
) const

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 MFnSpotLight::setBarnDoorAngle ( MBarnDoor  which_door,
const double &  barn_door_angle  
)

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 MFnSpotLight::useDecayRegions ( MStatus ReturnStatus = NULL  )  const

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:

MStatus MFnSpotLight::setUseDecayRegions ( const bool &  use_decay_regions  ) 

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:

float MFnSpotLight::startDistance ( MDecayRegion  which_region,
MStatus ReturnStatus = NULL  
) const

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 MFnSpotLight::setStartDistance ( MDecayRegion  which_region,
const float &  start_distance  
)

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 MFnSpotLight::endDistance ( MDecayRegion  which_region,
MStatus ReturnStatus = NULL  
) const

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 MFnSpotLight::setEndDistance ( MDecayRegion  which_region,
const float &  end_distance  
)

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 MFnSpotLight::create ( const MObject parent,
bool  UIvisible = true,
MStatus ReturnStatus = NULL  
)

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:

Autodesk® Maya® 2011 © 1997-2010 Autodesk, Inc. All rights reserved. Generated with doxygen 1.5.6