Panda3D
Public Member Functions | Static Public Member Functions | Public Attributes

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, bool texture_copy, Filename tout_dir, bool legacy_shader)
 Reads the Maya "shading engine" to determine the relevant shader properties.
void bind_uvsets (MayaFileToUVSetMap &map)
 Assigns the uvset_name of each MayaShaderColorDef using the given file-to-uvset map.
void clear_name ()
 Resets the Namable's name to empty.
void collect_maps ()
 Recalculates the all_maps list.
MayaShaderColorDefget_color_def (size_t idx=0) const
 This is part of the deprecated codepath.
const string & get_name () const
Colorf get_rgba (size_t idx=0) 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.
bool has_name () const
 Returns true if the Namable has a nonempty name set, false if the name is empty.
void output (ostream &out) const
 Outputs the Namable.
void set_name (const string &name)
void write (ostream &out) const

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type ()

Public Attributes

MayaShaderColorList _all_maps
MayaShaderColorList _color
MayaShaderColorList _color_maps
Colord _flat_color
MayaShaderColorList _gloss_maps
MayaShaderColorList _glow_maps
MayaShaderColorList _height_maps
bool _legacy_mode
MayaShaderColorList _normal_maps
MayaShaderColorList _trans_maps
MayaShaderColorDef _transparency

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 35 of file mayaShader.h.


Constructor & Destructor Documentation

MayaShader::MayaShader ( MObject  engine,
bool  texture_copy,
Filename  tout_dir,
bool  legacy_shader 
)

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

Definition at line 43 of file mayaShader.cxx.

Referenced by MayaShaders::find_shader_for_shading_engine().


Member Function Documentation

void MayaShader::bind_uvsets ( MayaFileToUVSetMap &  map)

Assigns the uvset_name of each MayaShaderColorDef using the given file-to-uvset map.

Definition at line 277 of file mayaShader.cxx.

Referenced by MayaShaders::find_shader_for_shading_engine().

void Namable::clear_name ( ) [inline, inherited]

Resets the Namable's name to empty.

Reimplemented in AsyncTask.

Definition at line 64 of file namable.I.

void MayaShader::collect_maps ( )

Recalculates the all_maps list.

Definition at line 175 of file mayaShader.cxx.

MayaShaderColorDef * MayaShader::get_color_def ( size_t  idx = 0) const

This is part of the deprecated codepath.

return the color def i.e. texture at idx

Definition at line 126 of file mayaShader.cxx.

Colorf MayaShader::get_rgba ( size_t  idx = 0) 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 146 of file mayaShader.cxx.

bool Namable::has_name ( ) const [inline, inherited]
void MayaShader::output ( ostream &  out) const

Outputs the Namable.

This function simply writes the name to the output stream; most Namable derivatives will probably redefine this.

Reimplemented from Namable.

Definition at line 105 of file mayaShader.cxx.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations