Esempio n. 1
0
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;
}
Esempio n. 2
0
MStatus uninitializePlugin(MObject object)

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

}
Esempio n. 3
0
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;
}
//-----------------------------------------------------------------------------
// 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;
}
//-----------------------------------------------------------------------------
// 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 );
}
Esempio n. 6
0
// 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;
}
Esempio n. 7
0
//! 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;
}
//-----------------------------------------------------------------------------
// 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 );
}
Esempio n. 9
0
//! 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;
}
Esempio n. 10
0
//======================================================================
//
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;
}
Esempio n. 11
0
MStatus ovalLocator::unregisterMe (MFnPlugin &plugin) {
	MHWRender::MDrawRegistry::deregisterDrawOverrideCreator (
		ovalLocator::drawDbClassification,
		ovalLocator::drawRegistrantId
	) ;
	return (plugin.deregisterNode (ovalLocator::id)) ;
}
//-----------------------------------------------------------------------------
// Register
//-----------------------------------------------------------------------------
MStatus CVsMayaMPxDragAndDropBehavior::Register(
	MFnPlugin &pluginFn,
	const MString &name,
	MCreatorFunction creatorFunction )
{
	return pluginFn.registerDragAndDropBehavior(
		name,
		creatorFunction );
}
    //
    // 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;
    }
Esempio n. 14
0
//
// 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;
}
//-----------------------------------------------------------------------------
// Register
//-----------------------------------------------------------------------------
MStatus CVsMayaMPxLocatorNode::Register(
	MFnPlugin &pluginFn,
	const MString &name,
	const MTypeId &typeId,
	MCreatorFunction creatorFunction,
	MInitializeFunction initFunction )
{
	return pluginFn.registerNode(
		name,
		typeId,
		creatorFunction,
		initFunction,
		MPxNode::kLocatorNode );
}
//-----------------------------------------------------------------------------
// Register
//-----------------------------------------------------------------------------
MStatus CVsMayaMPxShapeNode::Register(
	MFnPlugin &pluginFn,
	const MString &name,
	const MTypeId &typeId,
	MCreatorFunction creatorFunction,
	MInitializeFunction initFunction,
	MCreatorFunction uiCreatorFunction )
{
	return pluginFn.registerShape(
		name,
		typeId,
		creatorFunction,
		initFunction,
		uiCreatorFunction );
}
Esempio n. 17
0
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) ;
}
//-----------------------------------------------------------------------------
// Register
//-----------------------------------------------------------------------------
MStatus CVsMayaMPxNode::Register(
	MFnPlugin &pluginFn,
	const MString &name,
	const MTypeId &typeId,
	MCreatorFunction creatorFunction,
	MInitializeFunction initFunction,
	const MString &classification )
{
	return pluginFn.registerNode(
		name,
		typeId,
		creatorFunction,
		initFunction,
		MPxNode::kDependNode,
		classification.length() ? &classification : NULL );
}
	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;
	}
	bool  PhysicalsunNodeVisitor::unregist(MFnPlugin &plugin)
	{
		//CM_TRACE_FUNC("PhysicalsunNodeVisitor::unregist()");

		MStatus status;

		RNodeVisitorMgr::getInstancePtr()->unregist(
			PhysicalsunNode::getTypeName().asChar()
			);

		status = MSwatchRenderRegister::unregisterSwatchRender(renderman::PhysicalsunNode::getTypeName()+"Swatch");
		IfMErrorMsgReturnIt( status, "Can't deregister "+renderman::PhysicalsunNode::getTypeName()+"Swatch generator" );
		status = plugin.deregisterNode( renderman::PhysicalsunNode::getTypeId() );
		IfMErrorMsgReturnIt( status, "Can't deregister "+renderman::PhysicalsunNode::getTypeName()+" node" );

		return true;
	}
//-----------------------------------------------------------------------------
// Register
//-----------------------------------------------------------------------------
MStatus CVsMayaMPxFileTranslator::Register(
	MFnPlugin &pluginFn,
	const MString &name,
	const MString &guiName,
	MCreatorFunction creatorFunction )
{
	const MString pixmapName( name + ".xpm" );
	const MString optionsScriptName( name + "TranslatorOptions" );

	return pluginFn.registerFileTranslator(
		guiName,
		const_cast<char *>( pixmapName.asChar() ),
		creatorFunction,
		const_cast<char *>( optionsScriptName.asChar() ),
		"",
		false );
}
//-----------------------------------------------------------------------------
// Deregister everything
//-----------------------------------------------------------------------------
MStatus CVsMayaMPxFactoryBase::DeregisterEverything( MFnPlugin &pluginFn )
{
	MStatus retVal;

	for ( const CVsMayaMPxFactoryBase *pFactory( s_pFirstFactory ); pFactory; pFactory = pFactory->m_pNextFactory )
	{
		const MStatus regStat( pFactory->Deregister( pluginFn ) );

		if ( !regStat )
		{
			MGlobal::displayWarning(
				pluginFn.name() + ": Couldn't Deregister \"" + pFactory->GetName() + "\"" );
			retVal = regStat;
		}
	}

	return retVal;
}
//-----------------------------------------------------------------------------
// Register
//-----------------------------------------------------------------------------
MStatus CVsMayaMPxTransform::Register(
	MFnPlugin &pluginFn,
	const MString &name,
	const MTypeId &typeId,
	MCreatorFunction creatorFunction,
	MInitializeFunction initFunction,
	MCreatorFunction xformCreatorFunction,
	const MTypeId &xformTypeId,
	const MString *classification )
{
	return pluginFn.registerTransform(
		name,
		typeId,
		creatorFunction,
		initFunction,
		xformCreatorFunction,
		xformTypeId,
		NULL );
}
Esempio n. 24
0
//
// Register node to plugin
//
MStatus curveColliderLocator::Register(MFnPlugin& ioPlugin)
{
	MStatus status = ioPlugin.registerNode(MAYA_CURVECOLLIDERLOCATOR_NAME, 
										   id, 
										   &creator,
										   &initialize,
										   MPxNode::kLocatorNode);
	
	if (!status)
	{
		status.perror("registerLocator");
	}
	
	if (MFAIL(status)) 
		return MReturnStatus(status, "Failed to register " MAYA_CURVECOLLIDERLOCATOR_NAME " locator");
	else
		Registered = true;
	
	return status;
}
	bool  PhysicalsunNodeVisitor::regist(MFnPlugin &plugin)
	{
		//CM_TRACE_FUNC("PhysicalsunNodeVisitor::regist()");

		MStatus status;

		status = plugin.registerNode( 
			renderman::PhysicalsunNode::getTypeName(), 
			renderman::PhysicalsunNode::getTypeId(), 
			renderman::PhysicalsunNode::creator, renderman::PhysicalsunNode::initialize, MPxNode::kDependNode,
			&renderman::light_classification);
		IfMErrorMsgReturnIt( status, "Can't register "+renderman::PhysicalsunNode::getTypeName()+" node" );
		status.clear();
		status = MSwatchRenderRegister::registerSwatchRender( renderman::PhysicalsunNode::getTypeName()+"Swatch", liqNodeSwatch::creator );
		IfMErrorMsgReturnIt( status, "Can't register "+renderman::PhysicalsunNode::getTypeName()+"Swatch" );

		RNodeVisitorMgr::getInstancePtr()->regist(
			PhysicalsunNode::getTypeName().asChar(),
			PhysicalsunNodeVisitor::getInstancePtr()
			);
		return true;
	}
	bool  FlatColorNodeVisitor::regist(MFnPlugin &plugin)
	{
		//CM_TRACE_FUNC("FlatColorNodeVisitor::regist()");

		MStatus status;

		status = plugin.registerNode( 
			elvishray::FlatColorNode::getTypeName(), 
			elvishray::FlatColorNode::getTypeId(), 
			elvishray::FlatColorNode::creator, elvishray::FlatColorNode::initialize, MPxNode::kDependNode,
			&elvishray::surface_classification);
		IfMErrorMsgReturnIt( status, "Can't register "+elvishray::FlatColorNode::getTypeName()+" node" );
		status.clear();
		status = MSwatchRenderRegister::registerSwatchRender( elvishray::FlatColorNode::getTypeName()+"Swatch", liqNodeSwatch::creator );
		IfMErrorMsgReturnIt( status, "Can't register "+elvishray::FlatColorNode::getTypeName()+"Swatch" );
		
		RNodeVisitorMgr::getInstancePtr()->regist(
			FlatColorNode::getTypeName().asChar(),
			FlatColorNodeVisitor::getInstancePtr()
			);
		return true;
	}
Esempio n. 27
0
MStatus uninitializePlugin (MObject obj)
{
  MFnPlugin plug (obj);
  plug.deregisterFileTranslator ("Adventure");
  return MS::kSuccess;
}
Esempio n. 28
0
MStatus initializePlugin (MObject obj)
{
  MFnPlugin plug (obj, "Rk", "0.1");
  plug.registerFileTranslator ("Adventure", nullptr, Ad::create_trans);
  return MS::kSuccess;
}
//-----------------------------------------------------------------------------
// Deregister
//-----------------------------------------------------------------------------
MStatus CVsMayaMPxShapeNode::Deregister(
	MFnPlugin &pluginFn,
	const MTypeId &typeId )
{
	return pluginFn.deregisterNode( typeId );
}
//-----------------------------------------------------------------------------
// Deregister
//-----------------------------------------------------------------------------
MStatus CVsMayaMPxDragAndDropBehavior::Deregister(
	MFnPlugin &pluginFn,
	const MString &name )
{
	return pluginFn.deregisterDragAndDropBehavior( name );
}