Panda3D
|
00001 // Filename: mayaSavePview.h 00002 // Created by: drose (27Oct03) 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 MAYASAVEPVIEW_H 00016 #define MAYASAVEPVIEW_H 00017 00018 // We don't want to include pre_maya_include.h here, since that would 00019 // necessitate linking with Pandatool's libmaya.dll, which would in 00020 // turn bring in a lot of stuff from panda that we don't really need. 00021 // Instead, we'll just define the Maya symbols we require here. 00022 00023 // Maya will try to typedef bool unless this symbol is defined. 00024 #ifndef _BOOL 00025 #define _BOOL 1 00026 #endif 00027 00028 #ifdef __MACH__ 00029 #undef _BOOL 00030 #include "maya/OpenMayaMac.h" 00031 #endif 00032 00033 // Even though we don't include any Panda headers, it's safe to 00034 // include this one, since it only defines some macros that we need to 00035 // make this program platform-independent. 00036 #include "dtool_config.h" 00037 00038 #ifdef PHAVE_IOSTREAM 00039 // This will ask Maya 5.0 or better to use the new <iostream> library 00040 // instead of the old <iostream.h> library. 00041 #define REQUIRE_IOSTREAM 00042 #endif // PHAVE_IOSTREAM 00043 00044 #include <maya/MArgList.h> 00045 #include <maya/MPxCommand.h> 00046 #include <maya/MObject.h> 00047 00048 //////////////////////////////////////////////////////////////////// 00049 // Class : MayaSavePview 00050 // Description : This class serves as a plug-in to Maya to save the 00051 // scene and view it using the external pview program, 00052 // rather than linking in any part of Panda to a Maya 00053 // plugin. 00054 // 00055 // Since it does not link with any Panda code, and hence 00056 // is a very lean plugin, it is less likely than 00057 // MayaPview to cause interoperability problems within 00058 // Maya. However, it does force a save-to-disk and a 00059 // spawning of a separate executable, including a 00060 // complete reloading of all of the Maya libraries, so 00061 // it is quite a bit slower to execute. And the 00062 // potential for interactive control is substantially 00063 // reduced. 00064 //////////////////////////////////////////////////////////////////// 00065 class MayaSavePview : public MPxCommand { 00066 public: 00067 MayaSavePview(); 00068 virtual MStatus doIt(const MArgList &args); 00069 00070 static void *creator(); 00071 }; 00072 00073 // Since we don't include any of the Panda headers (other than 00074 // dtool_config.h), we have to define this macro ourselves, to tell 00075 // Windows to export the following functions from the DLL. 00076 #ifdef WIN32_VC 00077 #define EXPCL_MISC __declspec(dllexport) 00078 #else 00079 #define EXPCL_MISC 00080 #endif 00081 00082 EXPCL_MISC MStatus initializePlugin(MObject obj); 00083 EXPCL_MISC MStatus uninitializePlugin(MObject obj); 00084 00085 00086 #endif