/* =========================================================================== maya2q3 - export .md3 files from maya Copyright (C) 2005 HermitWorks Entertainment Corporation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. =========================================================================== */ #include "common.h" #define CHECK_ERR if( !(err) ) { err.perror( "Plugin init/cleanup error." ); return err; } #define V( exp ) { err = (exp); CHECK_ERR; } static const char *g_vendor = "HermitWorks"; static const char *g_version = "3.3.8"; static const char *g_reqVer = "Any"; DLLEXPORT MStatus CDECL initializePlugin( MObject obj ) { MStatus err; MFnPlugin plugin( obj, g_vendor, g_version, g_reqVer, &err ); CHECK_ERR( err ); V( plugin.registerFileTranslator( md3::g_translatorName, "", md3::g_translatorCreator ) ); V( plugin.registerFileTranslator( bsp::g_translatorName, "", bsp::g_translatorCreator ) ); V( plugin.registerCommand( bsp::g_clDmpCmdName, bsp::g_clDmpCmdCreator, bsp::g_clDmpSyntaxCreator ) ); #if MAYA_API_VERSION >= 700 const MString &swatchName = MHWShaderSwatchGenerator::initialize(); const MString userClassify( "shader/surface/utility/:swatch/" + swatchName ); #else const MString userClassify( "shader/surface/utility/" ); #endif V( plugin.registerNode( shader::g_shaderName, shader::g_shaderTypeID, shader::g_shaderCreator, shader::g_shaderInit, MPxNode::kHwShaderNode, &userClassify ) ); V( plugin.registerDragAndDropBehavior( shader::g_behaviorName, shader::g_behaviorCreator ) ); V( plugin.registerCommand( cmd::g_cmdName, cmd::g_cmdCreator, cmd::g_cmdSyntaxCreator ) ); MGlobal::executeCommand( "source maya2q3.mel" ); return MS::kSuccess; } DLLEXPORT MStatus CDECL uninitializePlugin( MObject obj ) { MStatus err; MFnPlugin plugin( obj, g_vendor, g_version, g_reqVer, &err ); CHECK_ERR( err ); V( plugin.deregisterCommand( cmd::g_cmdName ) ); V( plugin.deregisterDragAndDropBehavior( shader::g_behaviorName ) ); V( plugin.deregisterNode( shader::g_shaderTypeID ) ); V( plugin.deregisterCommand( bsp::g_clDmpCmdName ) ); V( plugin.deregisterFileTranslator( bsp::g_translatorName ) ); V( plugin.deregisterFileTranslator( md3::g_translatorName ) ); return MS::kSuccess; }