Panda3D
|
00001 // Filename: mayaShaders.h 00002 // Created by: drose (11Feb00) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef MAYASHADERS_H 00016 #define MAYASHADERS_H 00017 00018 #include "pandatoolbase.h" 00019 00020 #include "pmap.h" 00021 #include "pvector.h" 00022 #include "mayaShaderColorDef.h" 00023 00024 class MayaShader; 00025 class MObject; 00026 00027 //////////////////////////////////////////////////////////////////// 00028 // Class : MayaShaders 00029 // Description : Collects the set of MayaShaders that have been 00030 // encountered so far. 00031 //////////////////////////////////////////////////////////////////// 00032 class MayaShaders { 00033 public: 00034 MayaShaders(); 00035 ~MayaShaders(); 00036 MayaShader *find_shader_for_node(MObject node, bool legacy_shader); 00037 MayaShader *find_shader_for_shading_engine(MObject engine, bool legacy_shader); 00038 00039 int get_num_shaders() const; 00040 MayaShader *get_shader(int n) const; 00041 00042 MayaFileToUVSetMap _file_to_uvset; 00043 pvector<string> _uvset_names; 00044 void clear(); 00045 void bind_uvsets(MObject mesh); 00046 string find_uv_link(const string &match); 00047 00048 private: 00049 typedef pmap<string, MayaShader *> Shaders; 00050 Shaders _shaders; 00051 typedef pvector<MayaShader *> ShadersInOrder; 00052 ShadersInOrder _shaders_in_order; 00053 }; 00054 00055 #endif 00056