class MFnLightDataAttribute

Jump to documentation

: public MFnAttribute Light data attribute function set. (OpenMaya) (OpenMaya.py)

Inheritance:

MFnLightDataAttribute < MFnAttribute < MFnBase

public members:

MFnLightDataAttribute ()
MFnLightDataAttribute ( MObject & object, MStatus * ReturnStatus = NULL )
virtual ~MFnLightDataAttribute ()
virtual MFn::Type type () const
MObject create ( const MString & fullName, const MString & briefName, const MObject & direction, const MObject & intensity, const MObject & ambient, const MObject & diffuse, const MObject & specular, const MObject & shadowFraciton, const MObject & preShadowIntensity, const MObject & blindData, MStatus * ReturnStatus = NULL )
MStatus getDefault ( float & defDirectionX, float & defDirectionY, float & defDirectionZ, float & defIntensityR, float & defIntensityG, float & defIntensityB, bool & defAmbient, bool & defDiffuse, bool & defSpecular, float & defShadowFraction, float & defPreShadowIntensity, void* & defBlindData)
MStatus setDefault ( float defDirectionX, float defDirectionY, float defDirectionZ, float defIntensityR, float defIntensityG, float defIntensityB, bool defAmbient, bool defDiffuse, bool defSpecular, float defShadowFraction, float defPreShadowIntensity, void* defBlindData)
MObject child ( unsigned int index, MStatus * returnStatus )
MFnLightDataAttribute ( const MObject & object, MStatus * ReturnStatus = NULL )

Inherited from MFnAttribute:

public members:

virtual MFn::Type type () const
enum DisconnectBehavior
kDelete
delete array element on disconnect (array attributes only)
kReset
reset the attribute to its default on disconnect
kNothing
do nothing to the attribute's value on disconnect
bool isReadable ( MStatus * ReturnStatus=NULL ) const
bool isWritable ( MStatus * ReturnStatus=NULL ) const
bool isConnectable ( MStatus * ReturnStatus=NULL ) const
bool isStorable ( MStatus * ReturnStatus=NULL ) const
bool isCached ( MStatus * ReturnStatus=NULL ) const
bool isArray ( MStatus * ReturnStatus=NULL ) const
bool indexMatters ( MStatus * ReturnStatus=NULL ) const
bool isKeyable ( MStatus * ReturnStatus=NULL ) const
bool isChannelBoxFlagSet ( MStatus * ReturnStatus=NULL ) const
bool isHidden ( MStatus * ReturnStatus=NULL ) const
bool isUsedAsColor ( MStatus * ReturnStatus=NULL ) const
bool isIndeterminant ( MStatus * ReturnStatus=NULL ) const
bool isRenderSource ( MStatus * ReturnStatus=NULL ) const
bool isDynamic ( MStatus * ReturnStatus=NULL ) const
bool isWorldSpace ( MStatus * ReturnStatus=NULL ) const
bool isAffectsWorldSpace ( MStatus * ReturnStatus=NULL ) const
DisconnectBehavior disconnectBehavior ( MStatus * ReturnStatus=NULL ) const
bool usesArrayDataBuilder ( MStatus * ReturnStatus=NULL ) const
bool internal ( MStatus * ReturnStatus=NULL ) const
MStatus setReadable ( bool state )
MStatus setWritable ( bool state )
MStatus setConnectable ( bool state )
MStatus setStorable ( bool state )
MStatus setCached ( bool state )
MStatus setArray ( bool state )
MStatus setIndexMatters ( bool state )
MStatus setKeyable ( bool state )
MStatus setChannelBox ( bool state )
MStatus setHidden ( bool state )
MStatus setUsedAsColor ( bool state )
MStatus setIndeterminant ( bool state )
MStatus setRenderSource ( bool state )
MStatus setWorldSpace ( bool state )
MStatus setAffectsWorldSpace ( bool state )
MStatus setDisconnectBehavior ( DisconnectBehavior behavior )
MStatus setUsesArrayDataBuilder ( bool state )
MStatus setInternal ( bool state )
bool accepts ( MFnData::Type type , MStatus * ReturnStatus=NULL ) const
bool accepts ( const MTypeId & id, MStatus * ReturnStatus=NULL ) const
MObject parent ( MStatus * ReturnStatus=NULL) const
MStatus setParent ( const MObject & parent )
MString name ( MStatus * ReturnStatus=NULL ) const
MString shortName ( MStatus * ReturnStatus=NULL ) const
MString getAddAttrCmd ( bool useLongName = false, MStatus * status=NULL ) const
public

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

Function set for light data attributes.
Description

Function object for LightData attributes. A LightData attribute describes a single light source, giving its direction and intensity, as well as specifying whether or not it contributes to the ambient, diffuse, and specular components of the shading model.

Functions

MFnLightDataAttribute:: MFnLightDataAttribute ()

Description

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

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

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

MFnLightDataAttribute:: ~MFnLightDataAttribute ()

Description

The class destructor.

MFn::Type MFnLightDataAttribute:: type () const

Description

Return the type of this function set.

Return Value

  • the constant MFn::kLightDataAttribute

MObject MFnLightDataAttribute:: create ( const MString & fullName, const MString & briefName, const MObject & direction, const MObject & intensity, const MObject & ambient, const MObject & diffuse, const MObject & specular, const MObject & shadowFraction, const MObject & preShadowIntensity, const MObject & blindData, MStatus * ReturnStatus )

Description

Creates a LightData attribute object.

The create method needs to be called on a per node basis. That means if you want to create and add the same attribute to multiple nodes, you need to call the create method for each node to get a unique MObject back. If you call create just once and add the attribute to multiple nodes, Maya will encounter a fatal error.

Arguments

  • fullName The full name of the attribute
  • briefName The brief name of the attribute
  • direction The 3Float child attribute that will represent the light direction
  • intensity The 3Float child attibute that will represent the light intensity
  • ambient The Boolean child attribute that specifies whether or not the light contributes to the ambient component of the shading model
  • diffuse The Boolean child attribute that specifies whether or not the light contributes to the diffuse component of the shading model
  • specular The Boolean child attribute that specifies whether or not the light contributes to the specular component of the shading model
  • shadowFraction The float attribute that will represent the percentage of the light that is in shadow with respect to the intersection point. 0 means the light is total visible to the intersection point and 1 means the light is total invisible to the intersection point.
  • preShadowIntensity The float attribute that will represetnt the light intensity without shadow consideration
  • ReturnStatus Status code for the operation.

Return Value

  • The newly created LightData attribute object.

Status Codes

  • MS::kInvalidParameter One of the specified child attribute pointers was NULL or was of the wrong type
  • MS::kSuccess The attribute object was successfully created.

MStatus MFnLightDataAttribute:: getDefault ( float & defDirectionX, float & defDirectionY, float & defDirectionZ, float & defIntensityR, float & defIntensityG, float & defIntensityB, bool & defAmbient, bool & defDiffuse, bool & defSpecular, float & defShadowFraction, float & defPreShadowIntensity, void* & defBlindData)

Description

Gets the default value for the attribute.

Arguments

  • defDirectionX returns the default x component of light direction
  • defDirectionY returns the default y component of light direction
  • defDirectionZ returns the default z component of light direction
  • defIntensityR returns the default red component of light intensity
  • defIntensityG returns the default green component of light intensity
  • defIntensityB returns the default blue component of light intensity
  • defAmbient returns the default ambient flag
  • defDiffuse returns the default diffuse flag
  • defSpecular returns the default specular flag
  • defShadowFraction returns the default shadow fraction flag
  • defPreShadowIntensity returns the default pre shadow intensity flag
  • defBlindData returns the default blind data

Return Value

  • Status flag

Status Codes

  • MS::kSuccess The defaults were successfully queried

MStatus MFnLightDataAttribute:: setDefault ( float defDirectionX, float defDirectionY, float defDirectionZ, float defIntensityR, float defIntensityG, float defIntensityB, bool defAmbient, bool defDiffuse, bool defSpecular, float defShadowFraction, float defPreShadowIntensity, void* defBlindData)

Description

Sets the default value for the attribute.

Arguments

  • defDirectionX Default x component of light direction
  • defDirectionY Default y component of light direction
  • defDirectionZ Default z component of light direction
  • defIntensityR Default red component of light intensity
  • defIntensityG Default green component of light intensity
  • defIntensityB Default blue component of light intensity
  • defAmbient Default ambient flag
  • defDiffuse Default diffuse flag
  • defSpecular Default specular flag
  • defShadowFraction Default shadow fraction flag
  • defPreShadowIntensity Default pre shadow intensity flag
  • defBlindData Default blind data

Return Value

  • Status flag

Status Codes

  • MS::kSuccess The defaults were successfully set

MObject MFnLightDataAttribute:: child ( unsigned int index, MStatus * ReturnStatus )

Description

Gets a pointer to one of the child attributes.

Arguments

  • index Specifies which child is desired: 0 = direction 1 = intensity 2 = ambient flag 3 = diffuse flag 4 = specular flag 5 = shadow fraction flag 6 = pre shadow intensity flag 7 = blind data flag

  • ReturnStatus Status code for the operation

Return Value

  • A pointer to the desired child attribute

Status Codes

  • MS::kSuccess The child was successfully retrieved
  • MS::kFailure The child was not successfully retrieved

This class has no child classes.


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