MFnLightDataAttribute Class Reference
[OpenMaya - API module for common classesFunctionSet classes]

#include <MFnLightDataAttribute.h>
Inheritance diagram for MFnLightDataAttribute:
Inheritance graph
[legend]
Collaboration diagram for MFnLightDataAttribute:
Collaboration graph
[legend]

List of all members.


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.


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)
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)
  Constructor.

Protected Member Functions

virtual const char *  className () const
  Class name.

Constructor & Destructor Documentation

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

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

Function set type.

Return the class type : MFn::kLightDataAttribute

Reimplemented from MFnAttribute.

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

Class name.

Return the class name : "MFnLightDataAttribute"

Reimplemented from MFnAttribute.

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 = 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]  fullName  The full name of the attribute
[in]  briefName  The brief name of the attribute
[in]  direction  The 3Float child attribute that will represent the light direction
[in]  intensity  The 3Float child attibute that will represent the light intensity
[in]  ambient  The Boolean child attribute that specifies whether or not the light contributes to the ambient component of the shading model
[in]  diffuse  The Boolean child attribute that specifies whether or not the light contributes to the diffuse component of the shading model
[in]  specular  The Boolean child attribute that specifies whether or not the light contributes to the specular component of the shading model
[in]  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.
[in]  preShadowIntensity  The float attribute that will represetnt the light intensity without shadow consideration
[in]  blindData  Attribute to hold the light's blind data.
[out]  ReturnStatus  Status code for the operation.
Returns:
The newly created LightData attribute object.
Status Codes:
Examples:

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  
)

Gets the default value for the attribute.

Parameters:
[out]  defDirectionX  returns the default x component of light direction
[out]  defDirectionY  returns the default y component of light direction
[out]  defDirectionZ  returns the default z component of light direction
[out]  defIntensityR  returns the default red component of light intensity
[out]  defIntensityG  returns the default green component of light intensity
[out]  defIntensityB  returns the default blue component of light intensity
[out]  defAmbient  returns the default ambient flag
[out]  defDiffuse  returns the default diffuse flag
[out]  defSpecular  returns the default specular flag
[out]  defShadowFraction  returns the default shadow fraction flag
[out]  defPreShadowIntensity  returns the default pre shadow intensity flag
[out]  defBlindData  returns the default blind data
Returns:
Status flag
Status Codes:

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  
)

Sets the default value for the attribute.

Parameters:
[in]  defDirectionX  Default x component of light direction
[in]  defDirectionY  Default y component of light direction
[in]  defDirectionZ  Default z component of light direction
[in]  defIntensityR  Default red component of light intensity
[in]  defIntensityG  Default green component of light intensity
[in]  defIntensityB  Default blue component of light intensity
[in]  defAmbient  Default ambient flag
[in]  defDiffuse  Default diffuse flag
[in]  defSpecular  Default specular flag
[in]  defShadowFraction  Default shadow fraction flag
[in]  defPreShadowIntensity  Default pre shadow intensity flag
[in]  defBlindData  Default blind data
Returns:
Status flag
Status Codes:
Examples:

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

Gets a pointer to one of the child attributes.

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

Autodesk® Maya® 2011 © 1997-2010 Autodesk, Inc. All rights reserved. Generated with doxygen 1.5.6