Panda3D
 All Classes Functions Variables Enumerations
mayaCopy.h
1 // Filename: mayaCopy.h
2 // Created by: drose (10May02)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef MAYACOPY_H
16 #define MAYACOPY_H
17 
18 #include "pandatoolbase.h"
19 #include "cvsCopy.h"
20 #include "mayaApi.h"
21 #include "mayaShaders.h"
22 #include "dSearchPath.h"
23 #include "pointerTo.h"
24 
25 #include "pset.h"
26 
27 class MayaShader;
28 class MayaShaderColorDef;
29 class MDagPath;
30 
31 ////////////////////////////////////////////////////////////////////
32 // Class : MayaCopy
33 // Description : A program to copy Maya .mb files into the cvs
34 // tree.
35 ////////////////////////////////////////////////////////////////////
36 class MayaCopy : public CVSCopy {
37 public:
38  MayaCopy();
39 
40  void run();
41 
42 protected:
43  virtual bool copy_file(const Filename &source, const Filename &dest,
44  CVSSourceDirectory *dir, void *extra_data,
45  bool new_file);
46 
47  virtual string filter_filename(const string &source);
48 
49 private:
50  enum FileType {
51  FT_maya,
52  FT_texture
53  };
54 
55  class ExtraData {
56  public:
57  FileType _type;
58  MayaShader *_shader;
59  };
60 
61  bool copy_maya_file(const Filename &source, const Filename &dest,
62  CVSSourceDirectory *dir);
63  bool extract_texture(MayaShaderColorDef &color_def, CVSSourceDirectory *dir);
64  bool copy_texture(const Filename &source, const Filename &dest,
65  CVSSourceDirectory *dir);
66 
67  bool collect_shaders();
68  bool collect_shader_for_node(const MDagPath &dag_path);
69 
70  bool _keep_ver;
71  bool _omit_tex;
72  bool _omit_ref;
73  int _curr_idx;
74  bool _maya_ascii;
75  /*
76  vector_string _replace_prefix;
77  */
78 
79  vector_string _exec_string;
80 
81  PT(MayaApi) _maya;
82  MayaShaders _shaders;
83 };
84 
85 #endif
Collects the set of MayaShaders that have been encountered so far.
Definition: mayaShaders.h:32
This is the base class for a family of programs that copy files, typically model files like ...
Definition: cvsCopy.h:33
This represents one particular directory in the hierarchy of source directory files.
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44
This defines the various attributes that Maya may associate with the "color" channel for a particular...
Corresponds to a single "shader" in Maya.
Definition: mayaShader.h:35
A program to copy Maya .mb files into the cvs tree.
Definition: mayaCopy.h:36
This class presents a wrapper around the global Maya interface.
Definition: mayaApi.h:33