Panda3D
|
00001 // Filename: mayaCopy.h 00002 // Created by: drose (10May02) 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 MAYACOPY_H 00016 #define MAYACOPY_H 00017 00018 #include "pandatoolbase.h" 00019 #include "cvsCopy.h" 00020 #include "mayaApi.h" 00021 #include "mayaShaders.h" 00022 #include "dSearchPath.h" 00023 #include "pointerTo.h" 00024 00025 #include "pset.h" 00026 00027 class MayaShader; 00028 class MayaShaderColorDef; 00029 class MDagPath; 00030 00031 //////////////////////////////////////////////////////////////////// 00032 // Class : MayaCopy 00033 // Description : A program to copy Maya .mb files into the cvs 00034 // tree. 00035 //////////////////////////////////////////////////////////////////// 00036 class MayaCopy : public CVSCopy { 00037 public: 00038 MayaCopy(); 00039 00040 void run(); 00041 00042 protected: 00043 virtual bool copy_file(const Filename &source, const Filename &dest, 00044 CVSSourceDirectory *dir, void *extra_data, 00045 bool new_file); 00046 00047 virtual string filter_filename(const string &source); 00048 00049 private: 00050 enum FileType { 00051 FT_maya, 00052 FT_texture 00053 }; 00054 00055 class ExtraData { 00056 public: 00057 FileType _type; 00058 MayaShader *_shader; 00059 }; 00060 00061 bool copy_maya_file(const Filename &source, const Filename &dest, 00062 CVSSourceDirectory *dir); 00063 bool extract_texture(MayaShaderColorDef &color_def, CVSSourceDirectory *dir); 00064 bool copy_texture(const Filename &source, const Filename &dest, 00065 CVSSourceDirectory *dir); 00066 00067 bool collect_shaders(); 00068 bool collect_shader_for_node(const MDagPath &dag_path); 00069 00070 bool _keep_ver; 00071 bool _omit_tex; 00072 bool _omit_ref; 00073 int _curr_idx; 00074 bool _maya_ascii; 00075 /* 00076 vector_string _replace_prefix; 00077 */ 00078 00079 vector_string _exec_string; 00080 00081 PT(MayaApi) _maya; 00082 MayaShaders _shaders; 00083 }; 00084 00085 #endif