Public Member Functions | Protected Member Functions

MFnLightDataAttribute Class Reference

Search for all occurrences

Detailed Description

Light data attribute function set.

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.

Examples:

anisotropicShader.cpp, backfillShader.cpp, lambertShader.cpp, lightShader.cpp, phongShader.cpp, and shadowMatteShader.cpp.

#include <MFnLightDataAttribute.h>

Inheritance diagram for MFnLightDataAttribute:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual MFn::Type type () const
 Function set type.
virtual ~MFnLightDataAttribute ()
 Destructor.
 MFnLightDataAttribute ()
 Default constructor.
 MFnLightDataAttribute (MObject &object, MStatus *ReturnStatus=NULL)
 Constructor.
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)
 Creates a LightData attribute object.
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)
 Gets the default value for the attribute.
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)
 Sets the default value for the attribute.
MObject child (unsigned int index, MStatus *returnStatus)
 Gets a pointer to one of the child attributes.
 MFnLightDataAttribute (const MObject &object, MStatus *ReturnStatus=NULL)
 Constructor.

Protected Member Functions

virtual const char * className () const
 Class name.

Constructor & Destructor Documentation

MFnLightDataAttribute ( MObject object,
MStatus ReturnStatus = NULL 
)

Constructor.

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

Parameters:
[in]objectThe MObject to attach the function set to
[out]ReturnStatusthe return status
Status Codes:
MFnLightDataAttribute ( const MObject object,
MStatus ReturnStatus = NULL 
)

Constructor.

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

Parameters:
[in]objectThe MObject to attach the function set to
[out]ReturnStatusthe return status
Status Codes:

Member Function Documentation

MFn::Type type ( ) const [virtual]

Function set type.

Return the class type : MFn::kLightDataAttribute.

Reimplemented from MFnAttribute.

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

Class name.

Return the class name : "MFnLightDataAttribute".

Reimplemented from MFnAttribute.

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 shadowFraction,
const MObject preShadowIntensity,
const MObject blindData,
MStatus ReturnStatus = NULL 
)

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.

Parameters:
[in]fullNameThe full name of the attribute
[in]briefNameThe brief name of the attribute
[in]directionThe 3Float child attribute that will represent the light direction
[in]intensityThe 3Float child attibute that will represent the light intensity
[in]ambientThe Boolean child attribute that specifies whether or not the light contributes to the ambient component of the shading model
[in]diffuseThe Boolean child attribute that specifies whether or not the light contributes to the diffuse component of the shading model
[in]specularThe Boolean child attribute that specifies whether or not the light contributes to the specular component of the shading model
[in]shadowFractionThe 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.
[in]preShadowIntensityThe float attribute that will represetnt the light intensity without shadow consideration
[in]blindDataAttribute to hold the light's blind data.
[out]ReturnStatusStatus code for the operation.
Returns:
The newly created LightData attribute object.
Status Codes:
Examples:
anisotropicShader.cpp, backfillShader.cpp, lambertShader.cpp, lightShader.cpp, phongShader.cpp, and shadowMatteShader.cpp.
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 
)

Gets the default value for the attribute.

Parameters:
[out]defDirectionXreturns the default x component of light direction
[out]defDirectionYreturns the default y component of light direction
[out]defDirectionZreturns the default z component of light direction
[out]defIntensityRreturns the default red component of light intensity
[out]defIntensityGreturns the default green component of light intensity
[out]defIntensityBreturns the default blue component of light intensity
[out]defAmbientreturns the default ambient flag
[out]defDiffusereturns the default diffuse flag
[out]defSpecularreturns the default specular flag
[out]defShadowFractionreturns the default shadow fraction flag
[out]defPreShadowIntensityreturns the default pre shadow intensity flag
[out]defBlindDatareturns the default blind data
Returns:
Status flag
Status Codes:
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 
)

Sets the default value for the attribute.

Parameters:
[in]defDirectionXDefault x component of light direction
[in]defDirectionYDefault y component of light direction
[in]defDirectionZDefault z component of light direction
[in]defIntensityRDefault red component of light intensity
[in]defIntensityGDefault green component of light intensity
[in]defIntensityBDefault blue component of light intensity
[in]defAmbientDefault ambient flag
[in]defDiffuseDefault diffuse flag
[in]defSpecularDefault specular flag
[in]defShadowFractionDefault shadow fraction flag
[in]defPreShadowIntensityDefault pre shadow intensity flag
[in]defBlindDataDefault blind data
Returns:
Status flag
Status Codes:
Examples:
anisotropicShader.cpp, backfillShader.cpp, lambertShader.cpp, lightShader.cpp, phongShader.cpp, and shadowMatteShader.cpp.
MObject child ( unsigned int  index,
MStatus ReturnStatus 
)

Gets a pointer to one of the child attributes.

Parameters:
[in]indexSpecifies 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
[out]ReturnStatusStatus code for the operation
Returns:
A pointer to the desired child attribute
Status Codes:

MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute
MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute MFnLightDataAttribute