Public Types | Public Member Functions | Protected Member Functions

MFnSpotLight Class Reference

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:
Inheritance graph
[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

Available doors for barnDoor-related methods.

Enumerator:
kLeft 

 

kRight 

 

kTop 

 

kBottom 

 


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:
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 ( 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 type ( ) const [virtual]

Function set type.

Return the class type : MFn::kSpotLight.

Reimplemented from MFnNonExtendedLight.

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

Class name.

Return the class name : "MFnSpotLight".

Reimplemented from MFnNonExtendedLight.

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

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