Panda3D

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
MayaShader Class Reference

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

`#include "mayaShader.h"`

Inheritance diagram for MayaShader:

## Public Member Functions
| MayaShader (MObject engine, 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 | collect_maps ()
| Recalculates the all_maps list.
MayaShaderColorDef * | get_color_def (size_t idx=0) const
| This is part of the deprecated codepath.
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.
void | output (std::ostream &out) const
void | write (std::ostream &out) const
Public Member Functions inherited from Namable
| Namable (const std::string &initial_name="")
void | clear_name ()
| Resets the Namable's name to empty.
const std::string & | get_name () const
bool | has_name () const
| Returns true if the Namable has a nonempty name set, false if the name is empty.
void | output (std::ostream &out) const
| Outputs the Namable.
void | set_name (const std::string &name)
Public Member Functions inherited from MemoryBase
void | operator delete (void *, void *)
void | operator delete (void *ptr)
void | operator delete[] (void *, void *)
void | operator delete[] (void *ptr)
void * | operator new (size_t size)
void * | operator new (size_t size, void *ptr)
void * | operator new[] (size_t size)
void * | operator new[] (size_t size, void *ptr)

## 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
Public Attributes inherited from Namable
| get_name
| set_name

## Additional Inherited Members
Static Public Member Functions inherited from Namable
static TypeHandle | get_class_type ()
static void | init_type ()

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

## Constructor & Destructor Documentation

## ◆ MayaShader()

MayaShader::MayaShader | ( | MObject | engine,
|  | bool | legacy_shader )

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

Definition at line 42 of file mayaShader.cxx.

## ◆ ~MayaShader()

MayaShader::~MayaShader | ( |  | ) |

Definition at line 90 of file mayaShader.cxx.

## Member Function Documentation

## ◆ bind_uvsets()

void MayaShader::bind_uvsets | ( | MayaFileToUVSetMap & | map | ) |

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

Definition at line 254 of file mayaShader.cxx.

Referenced by MayaShaders::find_shader_for_shading_engine().

## ◆ collect_maps()

void MayaShader::collect_maps | ( |  | ) |

Recalculates the all_maps list.

Definition at line 157 of file mayaShader.cxx.

## ◆ get_color_def()

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 114 of file mayaShader.cxx.

## ◆ get_rgba()

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 130 of file mayaShader.cxx.

## ◆ output()

void MayaShader::output | ( | std::ostream & | out | ) | const

Definition at line 97 of file mayaShader.cxx.

## ◆ write()

void MayaShader::write | ( | std::ostream & | out | ) | const

Definition at line 105 of file mayaShader.cxx.

## Member Data Documentation

## ◆ _all_maps

MayaShaderColorList MayaShader::_all_maps

Definition at line 46 of file mayaShader.h.

## ◆ _color

MayaShaderColorList MayaShader::_color

Definition at line 69 of file mayaShader.h.

## ◆ _color_maps

MayaShaderColorList MayaShader::_color_maps

Definition at line 52 of file mayaShader.h.

## ◆ _flat_color

LColord MayaShader::_flat_color

Definition at line 50 of file mayaShader.h.

## ◆ _gloss_maps

MayaShaderColorList MayaShader::_gloss_maps

Definition at line 56 of file mayaShader.h.

## ◆ _glow_maps

MayaShaderColorList MayaShader::_glow_maps

Definition at line 55 of file mayaShader.h.

## ◆ _height_maps

MayaShaderColorList MayaShader::_height_maps

Definition at line 57 of file mayaShader.h.

## ◆ _legacy_mode

bool MayaShader::_legacy_mode

Definition at line 44 of file mayaShader.h.

## ◆ _normal_maps

MayaShaderColorList MayaShader::_normal_maps

Definition at line 54 of file mayaShader.h.

## ◆ _trans_maps

MayaShaderColorList MayaShader::_trans_maps

Definition at line 53 of file mayaShader.h.

## ◆ _transparency

MayaShaderColorDef MayaShader::_transparency

Definition at line 70 of file mayaShader.h.

The documentation for this class was generated from the following files:

- pandatool/src/maya/mayaShader.h
- pandatool/src/maya/mayaShader.cxx