Panda3D
|
Corresponds to a single "shader" in Maya. More...
#include "mayaShader.h"
Public Member Functions | |
MayaShader (MObject engine, bool legacy_shader) | |
Reads the Maya "shading engine" to determine the relevant shader properties. More... | |
void | bind_uvsets (MayaFileToUVSetMap &map) |
Assigns the uvset_name of each MayaShaderColorDef using the given file-to-uvset map. More... | |
void | collect_maps () |
Recalculates the all_maps list. More... | |
MayaShaderColorDef * | get_color_def (size_t idx=0) const |
This is part of the deprecated codepath. More... | |
LColor | 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. More... | |
void | output (ostream &out) const |
void | write (ostream &out) const |
![]() | |
Namable (const string &initial_name="") | |
Namable (const Namable ©) | |
void | clear_name () |
Resets the Namable's name to empty. More... | |
const string & | get_name () const |
bool | has_name () const |
Returns true if the Namable has a nonempty name set, false if the name is empty. More... | |
Namable & | operator= (const Namable &other) |
void | output (ostream &out) const |
Outputs the Namable. More... | |
void | set_name (const string &name) |
Public Attributes | |
MayaShaderColorList | _all_maps |
MayaShaderColorList | _color |
MayaShaderColorList | _color_maps |
LColord | _flat_color |
MayaShaderColorList | _gloss_maps |
MayaShaderColorList | _glow_maps |
MayaShaderColorList | _height_maps |
bool | _legacy_mode |
MayaShaderColorList | _normal_maps |
MayaShaderColorList | _trans_maps |
MayaShaderColorDef | _transparency |
Additional Inherited Members | |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
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.
MayaShader::MayaShader | ( | MObject | engine, |
bool | legacy_shader | ||
) |
Reads the Maya "shading engine" to determine the relevant shader properties.
Definition at line 43 of file mayaShader.cxx.
References get_color_def().
Referenced by MayaShaders::find_shader_for_shading_engine().
void MayaShader::bind_uvsets | ( | MayaFileToUVSetMap & | map | ) |
Assigns the uvset_name of each MayaShaderColorDef using the given file-to-uvset map.
Definition at line 274 of file mayaShader.cxx.
References collect_maps(), Filename::from_os_specific(), and Filename::get_basename_wo_extension().
Referenced by collect_maps(), and MayaShaders::find_shader_for_shading_engine().
void MayaShader::collect_maps | ( | ) |
Recalculates the all_maps list.
Definition at line 172 of file mayaShader.cxx.
References bind_uvsets().
Referenced by bind_uvsets(), and get_rgba().
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 123 of file mayaShader.cxx.
References get_rgba().
Referenced by MayaToEggConverter::clear(), and MayaShader().
LColor 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 143 of file mayaShader.cxx.
References collect_maps().
Referenced by MayaToEggConverter::clear(), and get_color_def().