当前位置: 首页>>代码示例>>C++>>正文


C++ MFnPlugin类代码示例

本文整理汇总了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;
}
开发者ID:DimondTheCat,项目名称:xray,代码行数:27,代码来源:rtgTranslator.cpp

示例2: uninitializePlugin

MStatus uninitializePlugin(MObject object)

{
	MFnPlugin pluginFn;
	pluginFn.deregisterNode(MTypeId(0x80008));
	return MS::kSuccess;

}
开发者ID:bungnoid,项目名称:MG_Tools,代码行数:8,代码来源:pluginMain.cpp

示例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;
}
开发者ID:mikowiec,项目名称:harvest,代码行数:11,代码来源:expTerrain.cpp

示例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;
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:55,代码来源:VsMayaMPxFactory.cpp

示例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 );
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:16,代码来源:VsMayaMPxFactory.cpp

示例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;
}
开发者ID:DimondTheCat,项目名称:xray,代码行数:15,代码来源:ge2Translator.cpp

示例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;
}
开发者ID:tody411,项目名称:MayaPluginSamples,代码行数:15,代码来源:InitPlugin.cpp

示例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 );
}
开发者ID:DeadZoneLuna,项目名称:SourceEngine2007,代码行数:18,代码来源:VsMayaMPxFactory.cpp

示例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;
}
开发者ID:tody411,项目名称:MayaPluginSamples,代码行数:16,代码来源:InitPlugin.cpp

示例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;
}
开发者ID:BigRoy,项目名称:Maya-devkit,代码行数:50,代码来源:metadataPlugin.cpp

示例11: unregisterMe

MStatus ovalLocator::unregisterMe (MFnPlugin &plugin) {
	MHWRender::MDrawRegistry::deregisterDrawOverrideCreator (
		ovalLocator::drawDbClassification,
		ovalLocator::drawRegistrantId
	) ;
	return (plugin.deregisterNode (ovalLocator::id)) ;
}
开发者ID:ADN-DevTech,项目名称:Maya-Locator,代码行数:7,代码来源:ovalLocator.cpp

示例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;
    }
开发者ID:juricast,项目名称:OpenCOLLADA,代码行数:47,代码来源:COLLADAMayaFileTranslator.cpp

示例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;
}
开发者ID:UIKit0,项目名称:stretchmesh,代码行数:16,代码来源:curveColliderLocator.cpp

示例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) ;
}
开发者ID:ADN-DevTech,项目名称:Maya-Locator,代码行数:16,代码来源:ovalLocator.cpp

示例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;
	}
开发者ID:maya2renderer,项目名称:maya2renderer,代码行数:17,代码来源:erFlatColor_node_visitor.cpp


注:本文中的MFnPlugin类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。