class MFnSpotLight

Jump to documentation

: public MFnNonExtendedLight Manage Spot Light dependency Nodes. (OpenMaya) (OpenMaya.py)

Inheritance:

MFnSpotLight < MFnNonExtendedLight < MFnNonAmbientLight < MFnLight < MFnDagNode < MFnDependencyNode < MFnBase

public members:

MFnSpotLight ( const MObject & object, MStatus * ReturnStatus = NULL )
enum MBarnDoor
enum MDecayRegion
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 )
MObject create ( const MObject & parent, bool UIvisible = true, MStatus * ReturnStatus = NULL )
NO SCRIPT SUPPORT

Inherited from MFnNonExtendedLight:

public members:

float shadowRadius ( MStatus * ReturnStatus = NULL ) const
MStatus setShadowRadius ( const float& shadow_radius )
bool castSoftShadows ( MStatus * ReturnStatus = NULL ) const
MStatus setCastSoftShadows ( const bool& cast_soft_shadows )
bool useDepthMapShadows ( MStatus * ReturnStatus = NULL ) const
MStatus setUseDepthMapShadows ( const bool& use_depth_map )
short depthMapFilterSize ( MStatus * ReturnStatus ) const
MStatus setDepthMapFilterSize ( const short& depth_map_filter_size )
short depthMapResolution ( MStatus * ReturnStatus ) const
MStatus setDepthMapResolution ( const short& depth_map_resolution )
float depthMapBias ( MStatus * ReturnStatus ) const
MStatus setDepthMapBias ( const float& depth_map_bias )

Inherited from MFnNonAmbientLight:

public members:

short decayRate ( MStatus * ReturnStatus = NULL ) const
MStatus setDecayRate ( const short& decay_rate )

Inherited from MFnLight:

public members:

MColor color ( MStatus * ReturnStatus = NULL ) const
MStatus setColor ( const MColor &col )
float intensity ( MStatus * ReturnStatus = NULL ) const
MStatus setIntensity ( const float& intens )
bool useRayTraceShadows ( MStatus * ReturnStatus = NULL ) const
MStatus setUseRayTraceShadows ( const bool& useRayTraceShadows )
MColor shadowColor ( MStatus * ReturnStatus = NULL ) const
MStatus setShadowColor ( const MColor & shadow_color )
double centerOfIllumination ( MStatus * ReturnStatus = NULL ) const
MStatus setCenterOfIllumination ( const double& dist )
short numShadowSamples ( MStatus * ReturnStatus = NULL ) const
MStatus setNumShadowSamples ( const short& num_shadow_samples )
short rayDepthLimit ( MStatus * ReturnStatus = NULL ) const
MStatus setRayDepthLimit ( const short& rayDepthLimit )
MColor opticalFXvisibility ( MStatus * ReturnStatus = NULL ) const
MStatus setOpticalFXvisibility ( const MColor & visibility )
MColor lightIntensity ( MStatus * ReturnStatus = NULL ) const
MFloatVector lightDirection ( int instance, MSpace::Space space = MSpace::kWorld , MStatus * ReturnStatus = NULL ) const
MFloatVector lightDirection ( MStatus * ReturnStatus = NULL ) const
bool lightAmbient ( MStatus * ReturnStatus = NULL ) const
bool lightDiffuse ( MStatus * ReturnStatus = NULL ) const
bool lightSpecular ( MStatus * ReturnStatus = NULL ) const

Inherited from MFnDagNode:

public members:

kNextPos
MObject create ( const MTypeId &typeId, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MObject create ( const MTypeId &typeId, const MString &name, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MObject create ( const MString &type, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
MObject create ( const MString &type, const MString &name, MObject & parent = MObject::kNullObj , MStatus * ReturnStatus = NULL )
unsigned int parentCount ( MStatus * ReturnStatus = NULL ) const
MObject parent ( unsigned int i, MStatus * ReturnStatus = NULL ) const
MStatus addChild ( MObject & child , unsigned int index = kNextPos , bool keepExistingParents = false )
MStatus removeChild ( MObject & child )
MStatus removeChildAt ( unsigned int index )
unsigned int childCount ( MStatus * ReturnStatus = NULL ) const
MObject child ( unsigned int i, MStatus * ReturnStatus = NULL ) const
MObject dagRoot ( MStatus * ReturnStatus = NULL )
bool hasParent ( const MObject & node, MStatus * ReturnStatus = NULL ) const
bool hasChild (const MObject & node, MStatus * ReturnStatus = NULL ) const
bool isChildOf (const MObject & node, MStatus * ReturnStatus = NULL ) const
bool isParentOf (const MObject & node, MStatus * ReturnStatus = NULL ) const
bool inUnderWorld ( MStatus * ReturnStatus = NULL ) const
bool inModel ( MStatus * ReturnStatus = NULL ) const
bool isInstanceable ( MStatus * ReturnStatus=NULL ) const
MStatus setInstanceable ( const bool how )
bool isInstanced ( bool indirect = true, MStatus * ReturnStatus = NULL ) const
bool isInstancedAttribute ( const MObject & attr, MStatus * ReturnStatus = NULL ) const
unsigned int instanceCount ( bool total, MStatus * ReturnStatus = NULL ) const
MObject duplicate ( bool instance = false, bool instanceLeaf = false, MStatus * ReturnStatus = NULL ) const
MStatus getPath ( MDagPath & path )
MStatus getAllPaths ( MDagPathArray & paths )
MString fullPathName ( MStatus *ReturnStatus = NULL)
MString partialPathName ( MStatus *ReturnStatus = NULL)
MMatrix transformationMatrix ( MStatus * ReturnStatus = NULL ) const
bool isIntermediateObject ( MStatus * ReturnStatus = NULL ) const
MStatus setIntermediateObject ( bool isIntermediate )
int objectColor ( MStatus * ReturnStatus = NULL ) const
MStatus setObjectColor ( int color )
bool usingObjectColor ( MStatus * ReturnStatus = NULL ) const
MStatus setUseObjectColor ( bool useObjectColor )
MBoundingBox boundingBox ( MStatus * ReturnStatus = NULL ) const
MDagPath dagPath ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( const MDagPath & path )
virtual MStatus setObject ( MObject & object )
MObject model ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( const MObject & object )

Inherited from MFnDependencyNode:

public members:

virtual MFn::Type type () const
enum MAttrClass
kGlobalDynamicAttr
kLocalDynamicAttr
MObject create ( const MTypeId & typeId , MStatus * ReturnStatus = NULL )
MObject create ( const MTypeId & typeId , const MString & name , MStatus * ReturnStatus = NULL )
MObject create ( const MString & type , MStatus * ReturnStatus = NULL )
MObject create ( const MString & type , const MString & name , MStatus * ReturnStatus = NULL )
MTypeId typeId ( MStatus * ReturnStatus = NULL ) const
MString typeName ( MStatus * ReturnStatus = NULL ) const
MString name ( MStatus * ReturnStatus = NULL ) const
MString setName ( const MString & name , MStatus * ReturnStatus = NULL )
MStatus getConnections ( MPlugArray & array ) const
unsigned int attributeCount ( MStatus * ReturnStatus=NULL) const
MObject attribute ( unsigned int index, MStatus * ReturnStatus=NULL) const
MObject reorderedAttribute ( unsigned int index, MStatus * ReturnStatus=NULL) const
MObject attribute ( const MString & attrName, MStatus * ReturnStatus=NULL) const
MAttrClass attributeClass ( const MObject & attr, MStatus * ReturnStatus=NULL) const
MStatus getAffectedAttributes ( const MObject & attr, MObjectArray & affectedAttributes ) const
MStatus getAffectedByAttributes ( const MObject & attr, MObjectArray & affectedByAttributes ) const
MPlug findPlug ( const MObject & attr, bool wantNetworkedPlug, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MString & attrName, bool wantNetworkedPlug, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MObject & attr, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MString & attrName, MStatus * ReturnStatus=NULL) const
MStatus addAttribute ( const MObject & attr, MAttrClass type = kLocalDynamicAttr )
MStatus removeAttribute ( const MObject & attr, MAttrClass type = kLocalDynamicAttr )
MPxNode * userNode ( MStatus * ReturnStatus=NULL ) const
bool isFromReferencedFile ( MStatus * ReturnStatus=NULL) const
bool isShared ( MStatus * ReturnStatus=NULL) const
bool hasUniqueName ( MStatus * ReturnStatus=NULL) const
MString parentNamespace ( MStatus * ReturnStatus=NULL) const
bool isLocked ( MStatus * ReturnStatus=NULL) const
MStatus setLocked ( bool locked )
static MString classification ( const MString & nodeTypeName )
bool isNewAttribute ( const MObject & attr, MStatus * ReturnStatus=NULL) const
static unsigned int allocateFlag ( const MString pluginName, MStatus * ReturnStatus=NULL )
static MStatus deallocateFlag (const MString pluginName, unsigned int flag)
static MStatus deallocateAllFlags (const MString pluginName)
MStatus setFlag (unsigned int flag, bool state)
bool isFlagSet (unsigned int flag, MStatus * ReturnStatus=NULL) const
bool isDefaultNode ( MStatus * ReturnStatus=NULL) const
MStatus setDoNotWrite ( bool flag )
bool canBeWritten ( MStatus * ReturnStatus=NULL) const
bool hasAttribute (const MString & name , MStatus * ReturnStatus=NULL) const
MObject getAliasAttr (bool force, MStatus * ReturnStatus=NULL)
bool setAlias (const MString & alias,const MString & name , const MPlug & plug, bool add=true, MStatus * ReturnStatus=NULL)
bool findAlias (const MString & alias, MObject & attrObj, MStatus * ReturnStatus=NULL) const
bool getAliasList ( MStringArray & strArray, MStatus * ReturnStatus=NULL)
MString plugsAlias (const MPlug & plug, MStatus * ReturnStatus=NULL)
public
bool getPlugsAlias (const MPlug & plug, MString & aliasName, MStatus * ReturnStatus=NULL)

Inherited from MFnBase:

public members:

virtual MFn::Type type () const
bool hasObj ( MFn::Type ) const
bool hasObj ( const MObject & ) const
MObject object ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( MObject & object )
virtual MStatus setObject ( const MObject & object )

Documentation

Facilitate the creation and manipulation of spot light nodes
Description
MFnSpotLight facilitates creation and manipulation of dependency graph nodes representing spotlights.

Functions

MFnSpotLight:: MFnSpotLight ()

Description

Default class constructor. The function set is not attached to an MObject.

MFnSpotLight:: MFnSpotLight ( MObject & object, MStatus * ReturnStatus )

Description

Class constructor that initializes the function set to the given MObject.

Arguments

  • object the MObject to attach the function set to
  • ReturnStatus the return status
    • 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:: MFnSpotLight ( const MObject & object, MStatus * ReturnStatus )

Description

Class constructor that initializes the function set to the given constant MObject.

Arguments

  • object the const MObject to attach the function set to
  • ReturnStatus the return status
    • 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:: MFnSpotLight ( const MDagPath & object, MStatus * ReturnStatus )

Description

Class constructor that initializes the function set to the given constant MDagPath object.

Arguments

  • object the const MDagPath to attach the function set to
  • ReturnStatus the return status
    • 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

MFn::Type MFnSpotLight:: type () const

Description

Return the type of this function set.

Return Value

  • the constant MFn::kSpotLight

MFnSpotLight:: ~MFnSpotLight ()

Description

The class destructor.

MObject MFnSpotLight:: create ( bool UIvisible, MStatus * ReturnStatus )

Description

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.

Arguments

  • UIvisible determines whether or not to connect the new node to the light classification node and add it to the default light list.
  • ReturnStatus return status

Return Value

  • 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 MFnSpotLight:: create ( const MObject & parent, bool UIvisible, MStatus * ReturnStatus )

Description

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.

Arguments

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

Return Value

  • 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 MFnSpotLight:: create ( const MObject & parent, bool UIvisible, bool wantTransform, MStatus * ReturnStatus )

Description

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.

Arguments

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

Return Value

  • 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 MFnSpotLight:: coneAngle ( MStatus * ReturnStatus ) const

Description

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.

Arguments

  • ReturnStatus return status

Return Value

  • 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 MFnSpotLight:: setConeAngle ( const double& cone_angle )

Description

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

Arguments

  • cone_angle value to which the attribute will be set.

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set doesn not have a valid object,

double MFnSpotLight:: penumbraAngle ( MStatus * ReturnStatus ) const

Description

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.

Arguments

  • ReturnStatus return status

Return Value

  • 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 MFnSpotLight:: setPenumbraAngle ( const double& penumbra_angle )

Description

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

Arguments

  • penumbra_angle value to which the attribute will be set.

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set doesn not have a valid object,

double MFnSpotLight:: dropOff ( MStatus * ReturnStatus ) const

Description

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.

Arguments

  • ReturnStatus return status

Return Value

  • 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 MFnSpotLight:: setDropOff ( const double& drop_off )

Description

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

Arguments

  • dist value to which the attribute will be set.

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set doesn not have a valid object,

bool MFnSpotLight:: barnDoors ( MStatus * ReturnStatus ) const

Description

Retrieves the value of the "barnDoors" attribute of a light node. This attribute determines whether or not the light uses barn doors.

Arguments

  • ReturnStatus return status

Return Value

  • 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 MFnSpotLight:: setBarnDoors ( const bool& barn_doors)

Description

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

Arguments

  • barn_doors value to which the attribute will be set.

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid object,

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

Description

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.

Arguments

  • ReturnStatus return status

Return Value

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

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set doesn not have a valid object, or the specified barn door was invalid.

MStatus MFnSpotLight:: setBarnDoorAngle ( MBarnDoor which_door, const double& barn_door_angle )

Description

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

Arguments

  • dist value to which the attribute will be set.

Return Value

  • 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 ) const

Description

Retrieves the value of the "useDecayRegions" attribute of a light node. This attribute determines whether or not the light uses decay regions.

Arguments

  • ReturnStatus return status

Return Value

  • 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 MFnSpotLight:: setUseDecayRegions ( const bool& use_decay_regions)

Description

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

Arguments

  • barn_doors value to which the attribute will be set.

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid object,

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

Description

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.

Arguments

  • which_regions the decay region whose startDistance attribute is to be retrieved.
  • ReturnStatus return status

Return Value

  • 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 )

Description

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

Arguments

  • which_region the decay region whose start distance is to be set.
  • dist value to which the attribute will be set.

Return Value

  • 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 ) const

Description

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.

Arguments

  • which_regions the decay region whose endDistance attribute is to be retrieved.
  • ReturnStatus return status

Return Value

  • 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 )

Description

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

Arguments

  • which_region the decay region whose end distance is to be set.
  • dist value to which the attribute will be set.

Return Value

  • 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.

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright