Panda3D
 All Classes Functions Variables Enumerations
mayaSavePview.h
1 // Filename: mayaSavePview.h
2 // Created by: drose (27Oct03)
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 MAYASAVEPVIEW_H
16 #define MAYASAVEPVIEW_H
17 
18 // We don't want to include pre_maya_include.h here, since that would
19 // necessitate linking with Pandatool's libmaya.dll, which would in
20 // turn bring in a lot of stuff from panda that we don't really need.
21 // Instead, we'll just define the Maya symbols we require here.
22 
23 // Maya will try to typedef bool unless this symbol is defined.
24 #ifndef _BOOL
25 #define _BOOL 1
26 #endif
27 
28 #ifdef __MACH__
29 #undef _BOOL
30 #include "maya/OpenMayaMac.h"
31 #endif
32 
33 // Even though we don't include any Panda headers, it's safe to
34 // include this one, since it only defines some macros that we need to
35 // make this program platform-independent.
36 #include "dtool_config.h"
37 
38 #ifdef PHAVE_IOSTREAM
39 // This will ask Maya 5.0 or better to use the new <iostream> library
40 // instead of the old <iostream.h> library.
41 #define REQUIRE_IOSTREAM
42 #endif // PHAVE_IOSTREAM
43 
44 #include <maya/MArgList.h>
45 #include <maya/MPxCommand.h>
46 #include <maya/MObject.h>
47 
48 ////////////////////////////////////////////////////////////////////
49 // Class : MayaSavePview
50 // Description : This class serves as a plug-in to Maya to save the
51 // scene and view it using the external pview program,
52 // rather than linking in any part of Panda to a Maya
53 // plugin.
54 //
55 // Since it does not link with any Panda code, and hence
56 // is a very lean plugin, it is less likely than
57 // MayaPview to cause interoperability problems within
58 // Maya. However, it does force a save-to-disk and a
59 // spawning of a separate executable, including a
60 // complete reloading of all of the Maya libraries, so
61 // it is quite a bit slower to execute. And the
62 // potential for interactive control is substantially
63 // reduced.
64 ////////////////////////////////////////////////////////////////////
65 class MayaSavePview : public MPxCommand {
66 public:
67  MayaSavePview();
68  virtual MStatus doIt(const MArgList &args);
69 
70  static void *creator();
71 };
72 
73 // Since we don't include any of the Panda headers (other than
74 // dtool_config.h), we have to define this macro ourselves, to tell
75 // Windows to export the following functions from the DLL.
76 #ifdef WIN32_VC
77  #define EXPCL_MISC __declspec(dllexport)
78 #else
79  #define EXPCL_MISC
80 #endif
81 
82 EXPCL_MISC MStatus initializePlugin(MObject obj);
83 EXPCL_MISC MStatus uninitializePlugin(MObject obj);
84 
85 
86 #endif
static void * creator()
This is used to create a new instance of the plugin.
virtual MStatus doIt(const MArgList &args)
Called when the plugin command is invoked.
This class serves as a plug-in to Maya to save the scene and view it using the external pview program...
Definition: mayaSavePview.h:65