Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

MayaShader Class Reference

Corresponds to a single "shader" in Maya. More...

#include <mayaShader.h>

Inheritance diagram for MayaShader:

Namable List of all members.

Public Member Functions

 MayaShader (MObject engine)
 Reads the Maya "shading engine" to determine the relevant shader properties.

 ~MayaShader ()
void output (ostream &out) const
void write (ostream &out) const
Colorf get_rgba () const
 Returns the overall color of the shader as a single-precision rgba value, where the alpha component represents transparency according to the Panda convention.

void set_name (const string &name)
void clear_name ()
bool has_name () const
const string & get_name () const

Static Public Member Functions

TypeHandle get_class_type ()
void init_type ()

Public Attributes

MayaShaderColorDef _color
MayaShaderColorDef _transparency

Protected Attributes

string _name

Static Protected Attributes

TypeHandle _type_handle

Private Member Functions

bool read_surface_shader (MObject shader)
 Extracts out the shading information from the Maya surface shader.


Detailed Description

Corresponds to a single "shader" in Maya.

This extracts out all the parameters of a Maya shader that we might care about. There are many more parameters that we don't care about or don't know enough to extract.

Definition at line 49 of file mayaShader.h.


Constructor & Destructor Documentation

MayaShader::MayaShader MObject  engine  ) 
 

Reads the Maya "shading engine" to determine the relevant shader properties.

Definition at line 50 of file mayaShader.cxx.

MayaShader::~MayaShader  ) 
 

Definition at line 82 of file mayaShader.cxx.


Member Function Documentation

Colorf MayaShader::get_rgba  )  const
 

Returns the overall color of the shader as a single-precision rgba value, where the alpha component represents transparency according to the Panda convention.

If no overall color is specified (_has_flat_color is not true), this returns white.

Normally, Maya makes texture color override the flat color, so if a texture is also applied (_has_texture is true), this value is not used by Maya.

Definition at line 140 of file mayaShader.cxx.

References _color, MayaShaderColorDef::read_surface_color(), and size_t.

void MayaShader::output ostream &  out  )  const
 

Reimplemented from Namable.

Definition at line 94 of file mayaShader.cxx.

References _color, and _transparency.

bool MayaShader::read_surface_shader MObject  shader  )  [private]
 

Extracts out the shading information from the Maya surface shader.

Definition at line 174 of file mayaShader.cxx.

void MayaShader::write ostream &  out  )  const
 

Definition at line 107 of file mayaShader.cxx.

References _color, MayaShaderColorDef::_flat_color, MayaShaderColorDef::_has_flat_color, _transparency, and Colorf.


Member Data Documentation

MayaShaderColorDef MayaShader::_color
 

Definition at line 59 of file mayaShader.h.

Referenced by get_rgba(), output(), and write().

MayaShaderColorDef MayaShader::_transparency
 

Definition at line 60 of file mayaShader.h.

Referenced by output(), and write().


The documentation for this class was generated from the following files:
Generated on Fri May 2 03:27:38 2003 for Panda-Tool by doxygen1.3