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