//---------------------------------------------------------------------------
//  ccAttributeDispatcher.mel
//
//  Copyright (C) 2002 - 2009 SEGA Corporation CS R&D Support Department
//  All Rights Reserved.
//
//  Module  : ccAttributeDispatcher
//  File    : ccAttributeDispatcher.mel
//  Create  : 2006/06/16
//  Modify  : 2007/09/27 : Maya2008対応
//          : 2009/10/28 : OpenGL ES 1.1版対応
//          : 2011/06/29 : OpenGL ES 2.0, PS Vita版追加。
//  Version : 1.20.00
//  Note    : Ninja,NN,SymphonyのAttributeのDispatcher
//
//---------------------------------------------------------------------------
// SCA プラグインロード情報取得
proc int ccGetSCAPluginInfo()
{
	int $info = (`pluginInfo -query -loaded "Maya2011ScaLoadInfo"`	  ||
				 `pluginInfo -query -loaded "Maya2011x64ScaLoadInfo"` ||
				 `pluginInfo -query -loaded "Maya2012ScaLoadInfo"`	  ||
				 `pluginInfo -query -loaded "Maya2012x64ScaLoadInfo"` );
	return $info;
}

// NN プラグインロード情報取得
proc int ccGetNNPluginInfo()
{
	int $info = (
	// HND2 Exporter
/****
				 `pluginInfo -query -loaded "MAYA2011toHND2"`         ||
				 `pluginInfo -query -loaded "MAYA2011x64toHND2"`      ||
				 `pluginInfo -query -loaded "MAYA2012toHND2"`         ||
				 `pluginInfo -query -loaded "MAYA2012x64toHND2"`      ||
*****/
	// NN Exporter for GAMECUBE
				 `pluginInfo -query -loaded "MAYA2011toNNGC"`         ||
				 `pluginInfo -query -loaded "MAYA2012toNNGC"`         ||
	// NN Exporter for Playstation2
				 `pluginInfo -query -loaded "MAYA2011toNNPS2"`        ||
				 `pluginInfo -query -loaded "MAYA2011x64toNNPS2"`     ||
				 `pluginInfo -query -loaded "MAYA2012toNNPS2"`        ||
				 `pluginInfo -query -loaded "MAYA2012x64toNNPS2"`     ||
	// NN Exporter for PlayStation3
				 `pluginInfo -query -loaded "MAYA2011toNNPS3"`        ||
				 `pluginInfo -query -loaded "MAYA2011x64toNNPS3"`     ||
				 `pluginInfo -query -loaded "MAYA2012toNNPS3"`        ||
				 `pluginInfo -query -loaded "MAYA2012x64toNNPS3"`     ||
	// NN Exporter for PSP  
				 `pluginInfo -query -loaded "MAYA2011toNNPSP"`        ||
				 `pluginInfo -query -loaded "MAYA2011x64toNNPSP"`     ||
				 `pluginInfo -query -loaded "MAYA2012toNNPSP"`        ||
				 `pluginInfo -query -loaded "MAYA2012x64toNNPSP"`     ||
	// NN Exporter for DirectX G1.1
				 `pluginInfo -query -loaded "MAYA2011toNNXB"`         ||
				 `pluginInfo -query -loaded "MAYA2011x64toNNXB"`      ||
				 `pluginInfo -query -loaded "MAYA2012toNNXB"`         ||
				 `pluginInfo -query -loaded "MAYA2012x64toNNXB"`      ||
	// NN Exporter for Xbox360
				 `pluginInfo -query -loaded "MAYA2011toNNXB360"`      ||
				 `pluginInfo -query -loaded "MAYA2011x64toNNXB360"`   ||
				 `pluginInfo -query -loaded "MAYA2012toNNXB360"`      ||
				 `pluginInfo -query -loaded "MAYA2012x64toNNXB360"`   ||
	// NN Exporter for DirectX G2.0
				 `pluginInfo -query -loaded "MAYA2011toNNDXG2"`       ||
				 `pluginInfo -query -loaded "MAYA2011x64toNNDXG2"`    ||
				 `pluginInfo -query -loaded "MAYA2012toNNDXG2"`       ||
				 `pluginInfo -query -loaded "MAYA2012x64toNNDXG2"`    ||
	// NN Exporter for Lindbergh
				 `pluginInfo -query -loaded "MAYA2011toNNLB"`         ||
				 `pluginInfo -query -loaded "MAYA2011x64toNNLB"`      ||
				 `pluginInfo -query -loaded "MAYA2012toNNLB"`         ||
				 `pluginInfo -query -loaded "MAYA2012x64toNNLB"`      ||
	// NN Exporter for OpenGL ES1.1
				 `pluginInfo -query -loaded "MAYA2011toNNGLES11"`     ||
				 `pluginInfo -query -loaded "MAYA2011x64toNNGLES11"`  ||
				 `pluginInfo -query -loaded "MAYA2012toNNGLES11"`     ||
				 `pluginInfo -query -loaded "MAYA2012x64toNNGLES11"`  ||
	// NN Exporter for OpenGL ES2.0
				 `pluginInfo -query -loaded "MAYA2011toNNGLES20"`     ||
				 `pluginInfo -query -loaded "MAYA2011x64toNNGLES20"`  ||
				 `pluginInfo -query -loaded "MAYA2012toNNGLES20"`     ||
				 `pluginInfo -query -loaded "MAYA2012x64toNNGLES20"`  ||

	// NN Exporter for PS Vita
				 `pluginInfo -query -loaded "MAYA2011toNNVITA"`      ||
				 `pluginInfo -query -loaded "MAYA2011x64toNNVITA"`   ||
				 `pluginInfo -query -loaded "MAYA2012toNNVITA"`      ||
				 `pluginInfo -query -loaded "MAYA2012x64toNNVITA"`    );

	return $info;
}

global proc ccAttributeDispatcher( string $nodeName )
{
	string $nodeType =`nodeType $nodeName`;

	switch( $nodeType ) {
		case "mesh":
			if( ccGetSCAPluginInfo() )		SEGACustomAttribute( $nodeName );
			if( ccGetNNPluginInfo() )		nnNodeAttribute( $nodeName );
			break;
		case "locator":
			if( ccGetSCAPluginInfo() )		SEGACustomAttribute( $nodeName );
			if( ccGetNNPluginInfo() )		nnNodeAttribute( $nodeName );
			break;
		case "joint":
			if( ccGetSCAPluginInfo() )		SEGACustomAttribute( $nodeName );
			if( ccGetNNPluginInfo() )		nnNodeAttribute( $nodeName );
			break;
		case "ikHandle":
		case "ikEffector":
			if( ccGetSCAPluginInfo() )		SEGACustomAttribute( $nodeName );
			break;
		case "lambert":
		case "anisotropic":
		case "blinn":
		case "phong":
		case "phongE":
			if( ccGetSCAPluginInfo() )		SEGACustomAttribute( $nodeName );
			if( ccGetNNPluginInfo() )		nnMaterialAttribute( $nodeName );
			break;
		case "file":
			if( ccGetSCAPluginInfo() )		SEGACustomAttribute( $nodeName );
			if( ccGetNNPluginInfo() )		nnTextureAttribute( $nodeName );
			break;
		case "pointLight":
			if( ccGetSCAPluginInfo() )		SEGACustomAttribute( $nodeName );
			if( ccGetNNPluginInfo() )		nnPointLightAttribute( $nodeName );
			break;
		default:
			if( ccGetSCAPluginInfo() )		SEGACustomAttribute( $nodeName );
//			if( ccGetNNPluginInfo() )		nnNodeAttribute( $nodeName );
			break;
	}
}
// End of file
