本文整理汇总了C++中MFnPlugin类的典型用法代码示例。如果您正苦于以下问题:C++ MFnPlugin类的具体用法?C++ MFnPlugin怎么用?C++ MFnPlugin使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了MFnPlugin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initializePlugin
MStatus
initializePlugin (MObject obj)
{
MStatus status;
char version[256];
strcpy( version, rtgVersion );
strcat( version, "." );
strcat( version, DtAPIVersion() );
MFnPlugin plugin (obj, "RTG Translator for Maya", version, "Any");
//Register the translator with the system
status = plugin.registerFileTranslator ("rtg",
"rtgTranslator.rgb",
rtgTranslator::creator,
"rtgTranslatorOpts", "",
true);
if (!status)
{
status.perror ("registerFileTranslator");
//return status;
}
return status;
}
示例2: uninitializePlugin
MStatus uninitializePlugin(MObject object)
{
MFnPlugin pluginFn;
pluginFn.deregisterNode(MTypeId(0x80008));
return MS::kSuccess;
}
示例3: initializePlugin
MStatus initializePlugin( MObject obj )
{
MStatus status;
MFnPlugin plugin ( obj, "Peter Pipkorn Reaper Output", "0.1", "Any" );
status = plugin.registerCommand( "exportTerrain",
exportTerrain::creator,
exportTerrain::newSyntax);
return status;
}
示例4: RegisterEverything
//-----------------------------------------------------------------------------
// Register everything
//-----------------------------------------------------------------------------
MStatus CVsMayaMPxFactoryBase::RegisterEverything( MFnPlugin &pluginFn )
{
MStatus retVal;
// Set the name & description of the CVsMayaMPxFactoryCommand making sure not to conflict with
// an already existing command
MString pluginCommandName( pluginFn.name() );
bool nameOk( true );
for ( const CVsMayaMPxFactoryBase *pFactory( s_pFirstFactory ); pFactory; pFactory = pFactory->m_pNextFactory )
{
if ( pFactory->GetName() == pluginCommandName )
{
pluginCommandName += "PluginInfo";
nameOk = false;
break;
}
}
for ( int suffix( 0 ); !nameOk; nameOk = true, ++suffix )
{
for ( const CVsMayaMPxFactoryBase *pFactory( s_pFirstFactory ); pFactory; pFactory = pFactory->m_pNextFactory )
{
if ( pFactory->GetName() == pluginCommandName )
{
pluginCommandName += suffix;
nameOk = false;
continue;
}
}
}
CVsMayaMPxCommandDecorator< CVsMayaMPxFactoryCommand >::s_name = pluginCommandName;
CVsMayaMPxCommandDecorator< CVsMayaMPxFactoryCommand >::s_desc =
MString( "Displays information about and what's inside of the " ) + pluginFn.name() + " plugin.";
for ( const CVsMayaMPxFactoryBase *pFactory( s_pFirstFactory ); pFactory; pFactory = pFactory->m_pNextFactory )
{
const MStatus regStat( pFactory->Register( pluginFn ) );
if ( !regStat )
{
MGlobal::displayWarning(
pluginFn.name() + ": Couldn't Register \"" + pFactory->GetName() + "\"" );
retVal = regStat;
}
}
return retVal;
}
示例5: Deregister
//-----------------------------------------------------------------------------
// Deregister
//-----------------------------------------------------------------------------
MStatus CVsMayaMPxCommand::Deregister(
MFnPlugin &pluginFn,
const MString &name )
{
MString commandName( name );
MStatus regStat = pluginFn.deregisterCommand( commandName );
if ( !regStat )
return regStat;
commandName.toLowerCase();
return pluginFn.deregisterCommand( commandName );
}
示例6: plugin
// Shouldn't be any C functions trying to call us, should there?
/*extern "C" */MStatus uninitializePlugin ( MObject obj )
{
MStatus status;
MFnPlugin plugin (obj);
status = plugin.deregisterFileTranslator ("GE2");
if (!status)
{
status.perror ("deregisterFileTranslator");
return status;
}
return status;
}
示例7: uninitializePlugin
//! Uninitialize plugin for LaplacianSmoother.
MStatus uninitializePlugin ( MObject obj )
{
MStatus status;
MFnPlugin plugin ( obj );
status = plugin.deregisterNode ( LaplacianSmoother::id );
if ( !status )
{
status.perror ( "uninitialized plug-in" );
status.perror ( status.errorString( ) );
}
return status;
}
示例8: Register
//-----------------------------------------------------------------------------
// Register
//-----------------------------------------------------------------------------
MStatus CVsMayaMPxCommand::Register(
MFnPlugin &pluginFn,
const MString &name,
MCreatorFunction creatorFunction,
MCreateSyntaxFunction createSyntaxFunction )
{
MString commandName( name );
MStatus regStat = pluginFn.registerCommand( commandName, creatorFunction, createSyntaxFunction );
if ( !regStat )
return regStat;
commandName.toLowerCase();
return pluginFn.registerCommand( commandName, creatorFunction, createSyntaxFunction );
}
示例9: initializePlugin
//! Initialize plugin for LaplacianSmoother.
MStatus initializePlugin ( MObject obj )
{
MStatus status;
MFnPlugin plugin ( obj, "Tody", "1.0", "Any" );
status = plugin.registerNode ( LaplacianSmoother::getMayaName(), LaplacianSmoother::id, LaplacianSmoother::creator,
LaplacianSmoother::initialize, MPxNode::kDeformerNode );
if ( !status )
{
status.perror ( "initialized plug-in" );
status.perror ( status.errorString( ) );
}
return status;
}
示例10: initializePlugin
//======================================================================
//
MStatus initializePlugin( MObject obj )
{
MStatus status;
MFnPlugin plugin ( obj, "Autodesk", "1.0", "Any" );
//======================================================================
status = plugin.registerCommand( exportMetadataCmd::name(),
exportMetadataCmd::creator,
exportMetadataCmd::cmdSyntax );
if ( !status )
{
status.perror("registerCommand(exportMetadata)");
return status;
}
//======================================================================
status = plugin.registerCommand( importMetadataCmd::name(),
importMetadataCmd::creator,
importMetadataCmd::cmdSyntax );
if ( !status )
{
status.perror("registerCommand(importMetadata)");
return status;
}
//======================================================================
status = plugin.registerCommand( createMetadataCmd::name(),
createMetadataCmd::creator,
createMetadataCmd::cmdSyntax );
if ( !status )
{
status.perror("registerCommand(createMetadata)");
return status;
}
//======================================================================
status = plugin.registerNode( tweakMetadataNode::nodeName(),
tweakMetadataNode::id,
tweakMetadataNode::creator,
tweakMetadataNode::initialize );
if ( !status )
{
status.perror("registerNode(tweakMetadata)");
return status;
}
return MS::kSuccess;
}
示例11: unregisterMe
MStatus ovalLocator::unregisterMe (MFnPlugin &plugin) {
MHWRender::MDrawRegistry::deregisterDrawOverrideCreator (
ovalLocator::drawDbClassification,
ovalLocator::drawRegistrantId
) ;
return (plugin.deregisterNode (ovalLocator::id)) ;
}
示例12: uninitializePlugin
//
// Description:
// this method is called when the plug-in is unloaded from Maya. It
// deregisters all of the services that it was providing.
//
// Arguments:
// obj - a handle to the plug-in object (use MFnPlugin to access it)
//
MStatus MLL_EXPORT uninitializePlugin ( MObject obj )
{
MStatus status;
MFnPlugin plugin ( obj );
// Add plug-in feature de-registration here
// Export plug-in
status = plugin.deregisterFileTranslator ( COLLADAMaya::COLLADA_EXPORTER );
if ( !status )
{
status.perror ( "deregisterFileTranslator" );
MGlobal::displayWarning ( MString ( "Unable to unregister OpenCOLLADA exporter: " ) + status );
return status;
}
// Import plug-in
status = plugin.deregisterFileTranslator ( COLLADAMaya::COLLADA_IMPORTER );
if ( !status )
{
status.perror ( "deregisterFileTranslator" );
MGlobal::displayWarning ( MString ( "Unable to unregister OpenCOLLADA importer: " ) + status );
return status;
}
#if MAYA_API_VERSION >= 800
// Disable the shared-reference node options.
MGlobal::executeCommand ( "optionVar -iv \"referenceOptionsSharedReference\" 0;" );
MGlobal::executeCommand ( "optionVar -iv \"referenceOptionsShareDisplayLayers\" 0;" );
MGlobal::executeCommand ( "optionVar -iv \"referenceOptionsShareShaders\" 0;" );
#endif // MAYA 8.0 and 8.5
#ifdef _DEBUG
// Stop the error logging
MGlobal::stopErrorLogging();
#endif
return status;
}
示例13: Deregister
//
// Deregister node to plugin
//
MStatus curveColliderLocator::Deregister(MFnPlugin& ioPlugin)
{
// Deregister the node
//
MStatus status = ioPlugin.deregisterNode(id);
if (MFAIL(status))
return MReturnStatus(status, "Failed to deregister " MAYA_CURVECOLLIDERLOCATOR_NAME " locator");
else
Registered = false;
return status;
}
示例14: registerMe
MStatus ovalLocator::registerMe (MFnPlugin &plugin) {
plugin.registerNode (
"ovalLocator",
ovalLocator::id,
ovalLocator::creator,
ovalLocator::initialize,
MPxNode::kLocatorNode,
&ovalLocator::drawDbClassification
) ;
MHWRender::MDrawRegistry::registerDrawOverrideCreator (
ovalLocator::drawDbClassification,
ovalLocator::drawRegistrantId,
ovalLocatorDrawOverride::Creator
) ;
return (MS::kSuccess) ;
}
示例15: unregist
bool FlatColorNodeVisitor::unregist(MFnPlugin &plugin)
{
//CM_TRACE_FUNC("FlatColorNodeVisitor::unregist()");
MStatus status;
RNodeVisitorMgr::getInstancePtr()->unregist(
FlatColorNode::getTypeName().asChar()
);
status = MSwatchRenderRegister::unregisterSwatchRender(elvishray::FlatColorNode::getTypeName()+"Swatch");
IfMErrorMsgReturnIt( status, "Can't deregister "+elvishray::FlatColorNode::getTypeName()+"Swatch generator" );
status = plugin.deregisterNode( elvishray::FlatColorNode::getTypeId() );
IfMErrorMsgReturnIt( status, "Can't deregister "+elvishray::FlatColorNode::getTypeName()+" node" );
return true;
}