Panda3D
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 #define OSMac_ 1
30 // This defines MAYA_API_VERSION
31 #include <maya/MTypes.h>
32 #if MAYA_API_VERSION < 201600
33 #include <maya/OpenMayaMac.h>
34 #endif
35 #endif
36 
37 // Even though we don't include any Panda headers, it's safe to
38 // include this one, since it only defines some macros that we need to
39 // make this program platform-independent.
40 #include "dtool_config.h"
41 
42 #ifdef PHAVE_IOSTREAM
43 // This will ask Maya 5.0 or better to use the new <iostream> library
44 // instead of the old <iostream.h> library.
45 #define REQUIRE_IOSTREAM
46 #endif // PHAVE_IOSTREAM
47 
48 #include <maya/MArgList.h>
49 #include <maya/MPxCommand.h>
50 #include <maya/MObject.h>
51 
52 ////////////////////////////////////////////////////////////////////
53 // Class : MayaSavePview
54 // Description : This class serves as a plug-in to Maya to save the
55 // scene and view it using the external pview program,
56 // rather than linking in any part of Panda to a Maya
57 // plugin.
58 //
59 // Since it does not link with any Panda code, and hence
60 // is a very lean plugin, it is less likely than
61 // MayaPview to cause interoperability problems within
62 // Maya. However, it does force a save-to-disk and a
63 // spawning of a separate executable, including a
64 // complete reloading of all of the Maya libraries, so
65 // it is quite a bit slower to execute. And the
66 // potential for interactive control is substantially
67 // reduced.
68 ////////////////////////////////////////////////////////////////////
69 class MayaSavePview : public MPxCommand {
70 public:
71  MayaSavePview();
72  virtual MStatus doIt(const MArgList &args);
73 
74  static void *creator();
75 };
76 
77 // Since we don't include any of the Panda headers (other than
78 // dtool_config.h), we have to define this macro ourselves, to tell
79 // Windows to export the following functions from the DLL.
80 #ifdef WIN32_VC
81  #define EXPCL_MISC __declspec(dllexport)
82 #else
83  #define EXPCL_MISC
84 #endif
85 
86 EXPCL_MISC MStatus initializePlugin(MObject obj);
87 EXPCL_MISC MStatus uninitializePlugin(MObject obj);
88 
89 
90 #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:69