//
// Copyright (C) Single Scatter Fog
// 
// File: pluginMain.cpp
//
// Author: Maya Plug-in Wizard 2.0
//

#include "SingleScatterFogNode.h"
#include "SingleScatterShader.h"

#include <maya/MFnPlugin.h>

MStatus initializePlugin( MObject obj )
//
//	Description:
//		this method is called when the plug-in is loaded into Maya.  It 
//		registers all of the services that this plug-in provides with 
//		Maya.
//
//	Arguments:
//		obj - a handle to the plug-in object (use MFnPlugin to access it)
//
{ 
	MStatus   status;
	MFnPlugin plugin( obj, "Single Scatter Fog", "1.0", "Any" );
	const MString UserClassify( "shader/volume" );

	status = plugin.registerNode( "SingleScatterFog",
								  SingleScatterFog::id,
								  SingleScatterFog::creator,
								  SingleScatterFog::initialize,
								  MPxNode::kDependNode,
								  &UserClassify );
	
	if( !status )
		status.perror("registerNode");
	

	const MString UserClassify2( "shader/surface" );

	status = plugin.registerNode( "SingleScatterShader",
								  SingleScatterShader::id,
								  SingleScatterShader::creator,
								  SingleScatterShader::initialize,
								  MPxNode::kDependNode,
								  &UserClassify2 );
	
	if( !status )
		status.perror("registerNode");

	return status;
}

MStatus uninitializePlugin( MObject obj )
//
//	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 status;
	MFnPlugin plugin( obj );

	status = plugin.deregisterNode( SingleScatterFog::id );
	
	if( !status )
		status.perror("deregisterNode");
	

	status = plugin.deregisterNode( SingleScatterShader::id );
	
	if( !status )
		status.perror("deregisterNode");

	return status;
}
