class MFnLight

Jump to documentation

: public MFnDagNode Manage dependency graph nodes representing lights. (OpenMaya) (OpenMaya.py)

Inheritance:

MFnLight < MFnDagNode < MFnDependencyNode < MFnBase

public members:

MFnLight ( const MObject & object, MStatus * ReturnStatus = NULL )
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

MFnLight allows manipulation of dependency graph nodes representing lights.
Description
MFnLight allows the creation and manipulation of dependency graph nodes representing lights. This is the top level of a hierarchy of light node function sets. It permits manipulation of the attributes common to all types of lights.

Functions

MFnLight:: MFnLight ()

Description

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

MFnLight:: MFnLight ( 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

MFnLight:: MFnLight ( 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

MFnLight:: MFnLight ( 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 MFnLight:: type () const

Description

Return the type of this function set.

Return Value

  • the constant MFn::kLight

MFnLight:: ~MFnLight ()

Description

The class destructor.

MColor MFnLight:: color ( MStatus * ReturnStatus ) const

Description

Retrieves the value of the "color" attribute of a light node. This attribute represents the color of the light emitted by the light node.

Arguments

  • ReturnStatus return status

Return Value

  • The value of the "color" attribute of the light node.

Status Codes

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

MStatus MFnLight:: setColor ( const MColor &col )

Description

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

Arguments

  • col 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 MFnLight:: intensity ( MStatus * ReturnStatus ) const

Description

Retrieves the value of the "intensity" attribute of a light node. This attribute represents a uniform scaling factor applied to the light color.

Arguments

  • ReturnStatus return status

Return Value

  • The value of the "intensity" attribute of the light node.

Status Codes

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

MStatus MFnLight:: setIntensity ( const float& intens )

Description

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

Arguments

  • intens 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,

bool MFnLight:: useRayTraceShadows ( MStatus * ReturnStatus ) const

Description

Retrieves the value of the "useRayTraceShadows" attribute of a light node. This attribute determines whether or not the light should raytrace it's shadows.

Arguments

  • ReturnStatus return status

Return Value

  • The value of the "useRayTraceShadows" attribute of the light node.

Status Codes

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

MStatus MFnLight:: setUseRayTraceShadows ( const bool& useRayTraceShadows )

Description

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

Arguments

  • useRayTraceShadows 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,

MColor MFnLight:: shadowColor ( MStatus * ReturnStatus ) const

Description

Retrieves the value of the "shadowColor" attribute of a light node. This attribute represents the color of the shadows cast by the light.

Arguments

  • ReturnStatus return status

Return Value

  • The value of the "shadowColor" attribute of the light node.

Status Codes

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

MStatus MFnLight:: setShadowColor ( const MColor &shadow_color )

Description

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

Arguments

  • col 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 MFnLight:: centerOfIllumination ( MStatus * ReturnStatus ) const

Description

Retrieves the value of the "centerOfIllumination" attribute of a light node. This attribute represents the distance to the center of illumination of the light.

Arguments

  • ReturnStatus return status

Return Value

  • The value of the "centerOfIllumination" attribute of the light node.

Status Codes

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

MStatus MFnLight:: setCenterOfIllumination ( const double& dist )

Description

Sets the value of the "centerOfIllumination" 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,

short MFnLight:: numShadowSamples ( MStatus * ReturnStatus ) const

Description

Retrieves the value of the "numShadowSamples" attribute of a light node. This attribute represents the number of shadow samples per point used in occulusion testing.

Arguments

  • ReturnStatus return status

Return Value

  • The value of the "numShadowSamples" attribute of the light node.

Status Codes

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

MStatus MFnLight:: setNumShadowSamples ( const short& num_shadow_samples )

Description

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

Arguments

  • num_shadow_samples 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,

short MFnLight:: rayDepthLimit ( MStatus * ReturnStatus ) const

Description

Retrieves the value of the "rayDepthLimit" attribute of a light node. This attribute determines a cutoff point for shadow calculations related to the light. Rays whose depth is higher than the value of this attribute will not trigger a shadow calculation for the light.

Arguments

  • ReturnStatus return status

Return Value

  • The value of the "rayDepthLimit" attribute of the light node.

Status Codes

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

MStatus MFnLight:: setRayDepthLimit ( const short& ray_depth_limit )

Description

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

Arguments

  • ray_depth_limit 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,

MColor MFnLight:: opticalFXvisibility ( MStatus * ReturnStatus ) const

Description

Retrieves the value of the "opticalFXvisibility" attribute of a light node. This attribute represents an occlusion scaling factor for light glow effects on this light.

Arguments

  • ReturnStatus return status

Return Value

  • The value of the "opticalFXvisibility" attribute of the light node.

Status Codes

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

MStatus MFnLight:: setOpticalFXvisibility ( const MColor &visibility )

Description

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

Arguments

  • visibility 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,

MColor MFnLight:: lightIntensity ( MStatus * ReturnStatus ) const

Description

Retrieves the value of the "lightIntensity" attribute of a light node. This attribute represents the intensity of the light specified as a color.

Arguments

  • ReturnStatus return status

Return Value

  • The value of the "lightIntensity" attribute of the light node.

Status Codes

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

MFloatVector MFnLight:: lightDirection ( int instance, MSpace::Space space, MStatus * ReturnStatus ) const

Description

Returns the direction in which the light is pointing. This is only valid for lights which are associated with a direction, such as area, directional or spot lights. The vector returned is not normalized.

Arguments

  • instance The instance of the light for which to return the direction.
  • space The coordinate space for which the direction vector is returned. If MSpace::kWorld is passed in the vector will be in the lights world space. If any other MSpace::Space value in pass in the vector will be returned in object (or local) space.
  • ReturnStatus return status

Return Value

  • A vector containing the direction of the light is the specified coordinate system.

Status Codes

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

MFloatVector MFnLight:: lightDirection ( MStatus * ReturnStatus ) const

Description

Retrieves the value of the "lightDirection" attribute of a light node. This attribute represents the direction from the light to the point being shading.

NOTE: This value is only valid during the rendering phase. See lightDirection method above for actual light direction.

Arguments

  • ReturnStatus return status

Return Value

  • The value of the "lightDirection" attribute of the light node.

Status Codes

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

bool MFnLight:: lightAmbient ( MStatus * ReturnStatus ) const

Description

Retrieves the value of the "lightAmbient" attribute of a light node. This attribute indicates if the light has an ambient component.

Arguments

  • ReturnStatus return status

Return Value

  • The value of the "lightAmbient" attribute of the light node.

Status Codes

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

bool MFnLight:: lightDiffuse ( MStatus * ReturnStatus ) const

Description

Retrieves the value of the "lightDiffuse" attribute of a light node. This attribute indicates if the light has a diffuse component.

Arguments

  • ReturnStatus return status

Return Value

  • The value of the "lightDiffuse" attribute of the light node.

Status Codes

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

bool MFnLight:: lightSpecular ( MStatus * ReturnStatus ) const

Description

Retrieves the value of the "lightSpecular" attribute of a light node. This attribute indicates if the light has a specular component.

Arguments

  • ReturnStatus return status

Return Value

  • The value of the "lightSpecular" attribute of the light node.

Status Codes

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

Direct child classes:

- MFnNonAmbientLight
- MFnAmbientLight

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