//---------------------------------------------------------------------------
//  ccAttributeDispatcher.mel
//
//  Copyright (C) 2006 - 2008 Creative Center Graphics Section
//  All Rights Reserved.
//
//  Module  : ccAttributeDispatcher
//  File    : ccAttributeDispatcher.mel
//  Create  : 2006/06/16
//  Modify  : 2007/09/27 : Maya2008対応
//  Version : 1.18.23
//  Note    : Ninja,NN,SymphonyのAttributeのDispatcher
//
//---------------------------------------------------------------------------
// SCA プラグインロード情報取得
proc int ccGetSCAPluginInfo()
{
	int $info = (`pluginInfo -query -loaded "MAYA65 Symphony Custom Attribute"`   ||
				 `pluginInfo -query -loaded "MAYA7 Symphony Custom Attribute "`   ||
				 `pluginInfo -query -loaded "MAYA8 Symphony Custom Attribute "`   ||
//				 `pluginInfo -query -loaded "MAYA85 Symphony Custom Attribute"`   ||
				 `pluginInfo -query -loaded "Maya85ScaLoadInfo"`                  ||
				 `pluginInfo -query -loaded "Maya85x64ScaLoadInfo"`               ||
//				 `pluginInfo -query -loaded "MAYA2008 Symphony Custom Attribute"` );
				 `pluginInfo -query -loaded "Maya2008ScaLoadInfo"`                ||
				 `pluginInfo -query -loaded "Maya2008x64ScaLoadInfo"`             );
	return $info;
}

// NN プラグインロード情報取得
proc int ccGetNNPluginInfo()
{
	int $info = (`pluginInfo -query -loaded "MAYA7 HND Exporter                             "` ||
				 `pluginInfo -query -loaded "MAYA8 HND Exporter                             "` ||
//				 `pluginInfo -query -loaded "MAYA85 HND Exporter                            "` ||
				 `pluginInfo -query -loaded "MAYA85toHND"`                                     ||
				 `pluginInfo -query -loaded "MAYA2008 HND Exporter                          "` ||
				 `pluginInfo -query -loaded "MAYA2008toHND"`                                   ||
				 `pluginInfo -query -loaded "MAYA2009 HND Exporter                          "` ||

				 `pluginInfo -query -loaded "MAYA7 HND2 Exporter                            "` ||
				 `pluginInfo -query -loaded "MAYA8 HND2 Exporter                            "` ||
//				 `pluginInfo -query -loaded "MAYA85 HND2 Exporter                           "` ||
				 `pluginInfo -query -loaded "MAYA85toHND2"`                                    ||
				 `pluginInfo -query -loaded "MAYA2008 HND2 Exporter                         "` ||
				 `pluginInfo -query -loaded "MAYA2008toHND2"`                                  ||
				 `pluginInfo -query -loaded "MAYA2009 HND2 Exporter                         "` ||

				 `pluginInfo -query -loaded "MAYA7 NN Exporter for PlayStation2             "` ||
				 `pluginInfo -query -loaded "MAYA8 NN Exporter for PlayStation2             "` ||
//				 `pluginInfo -query -loaded "MAYA85 NN Exporter for PlayStation2            "` ||
				 `pluginInfo -query -loaded "MAYA85toNNPS2"`                                   ||
				 `pluginInfo -query -loaded "MAYA2008 NN Exporter for PlayStation2          "` ||
				 `pluginInfo -query -loaded "MAYA2008toNNPS2"`                                 ||
				 `pluginInfo -query -loaded "MAYA2009 NN Exporter for PlayStation2          "` ||

				 `pluginInfo -query -loaded "MAYA7 NN Exporter for GAMECUBE                 "` ||
				 `pluginInfo -query -loaded "MAYA8 NN Exporter for GAMECUBE                 "` ||
//				 `pluginInfo -query -loaded "MAYA85 NN Exporter for GAMECUBE                "` ||
				 `pluginInfo -query -loaded "MAYA85toNNGC"`                                    ||
				 `pluginInfo -query -loaded "MAYA2008 NN Exporter for GAMECUBE              "` ||
				 `pluginInfo -query -loaded "MAYA2008toNNGC"`                                  ||
				 `pluginInfo -query -loaded "MAYA2009 NN Exporter for GAMECUBE              "` ||

				 `pluginInfo -query -loaded "MAYA7 NN Exporter for DirectX G1.1             "` ||
				 `pluginInfo -query -loaded "MAYA8 NN Exporter for DirectX G1.1             "` ||
//				 `pluginInfo -query -loaded "MAYA85 NN Exporter for DirectX G1.1            "` ||
				 `pluginInfo -query -loaded "MAYA85toNNXB"`                                    ||
				 `pluginInfo -query -loaded "MAYA2008 NN Exporter for DirectX G1.1          "` ||
				 `pluginInfo -query -loaded "MAYA2008toNNXB"`                                  ||
				 `pluginInfo -query -loaded "MAYA2009 NN Exporter for DirectX G1.1          "` ||

				 `pluginInfo -query -loaded "MAYA7 NN Exporter for Lindbergh                "` ||
				 `pluginInfo -query -loaded "MAYA8 NN Exporter for Lindbergh                "` ||
//				 `pluginInfo -query -loaded "MAYA85 NN Exporter for Lindbergh               "` ||
				 `pluginInfo -query -loaded "MAYA85toNNLB"`                                    ||
				 `pluginInfo -query -loaded "MAYA2008 NN Exporter for Lindbergh             "` ||
				 `pluginInfo -query -loaded "MAYA2008toNNLB"`                                  ||
				 `pluginInfo -query -loaded "MAYA2009 NN Exporter for Lindbergh             "` ||

				 `pluginInfo -query -loaded "MAYA7 NN Exporter for PSP                      "` ||
				 `pluginInfo -query -loaded "MAYA8 NN Exporter for PSP                      "` ||
//				 `pluginInfo -query -loaded "MAYA85 NN Exporter for PSP                     "` ||
				 `pluginInfo -query -loaded "MAYA85toNNPSP"`                                   ||
				 `pluginInfo -query -loaded "MAYA2008 NN Exporter for PSP                   "` ||
				 `pluginInfo -query -loaded "MAYA2008toNNPSP"`                                 ||
				 `pluginInfo -query -loaded "MAYA2009 NN Exporter for PSP                   "` ||

//				 `pluginInfo -query -loaded "MAYA7 NN Exporter for DENSO Telematics 06Model "` ||
//				 `pluginInfo -query -loaded "MAYA8 NN Exporter for DENSO Telematics 06Model "` ||
//				 `pluginInfo -query -loaded "MAYA85 NN Exporter for DENSO Telematics 06Model"` ||
//				 `pluginInfo -query -loaded "MAYA85toNNDT06"`                                  ||

				 `pluginInfo -query -loaded "MAYA7 NN Exporter for XBOX360                  "` ||
				 `pluginInfo -query -loaded "MAYA8 NN Exporter for XBOX360                  "` ||
//				 `pluginInfo -query -loaded "MAYA85 NN Exporter for XBOX360                 "` ||
				 `pluginInfo -query -loaded "MAYA85toNNXB360"`                                 ||
				 `pluginInfo -query -loaded "MAYA2008 NN Exporter for XBOX360               "` ||
				 `pluginInfo -query -loaded "MAYA2008toNNXB360"`                               ||
				 `pluginInfo -query -loaded "MAYA2009 NN Exporter for XBOX360               "` ||

				 `pluginInfo -query -loaded "MAYA7 NN Exporter for PlayStation3             "` ||
				 `pluginInfo -query -loaded "MAYA8 NN Exporter for PlayStation3             "` ||
//				 `pluginInfo -query -loaded "MAYA85 NN Exporter for PlayStation3            "` ||
				 `pluginInfo -query -loaded "MAYA85toNNPS3"`                                   ||
				 `pluginInfo -query -loaded "MAYA2008 NN Exporter for PlayStation3          "` ||
				 `pluginInfo -query -loaded "MAYA2008toNNPS3"`                                 ||
				 `pluginInfo -query -loaded "MAYA2009 NN Exporter for PlayStation3          "` ||

				 `pluginInfo -query -loaded "MAYA7 NN Exporter for DirectX G2.0             "` ||
				 `pluginInfo -query -loaded "MAYA8 NN Exporter for DirectX G2.0             "` ||
//				 `pluginInfo -query -loaded "MAYA85 NN Exporter for DirectX G2.0            "` ||
				 `pluginInfo -query -loaded "MAYA85toNNDXG2"`                                  ||
				 `pluginInfo -query -loaded "MAYA2008 NN Exporter for DirectX G2.0          "` ||
				 `pluginInfo -query -loaded "MAYA2008toNNDXG2"`                                ||
				 `pluginInfo -query -loaded "MAYA2009 NN Exporter for DirectX G2.0          "` );
	return $info;
}


// Ninja プラグインロード情報取得
proc int ccGetNinjaPluginInfo()
{
//	int $info = (`pluginInfo -query -loaded "MAYA6 NINJA Exporter                           "` ||
	int $info = (`pluginInfo -query -loaded "MAYA65 NINJA Exporter                          "` ||
				 `pluginInfo -query -loaded "MAYA7 NINJA Exporter                           "` ||
				 `pluginInfo -query -loaded "MAYA8 NINJA Exporter                           "` ||
//				 `pluginInfo -query -loaded "MAYA85 NINJA Exporter                          "` ||
				 `pluginInfo -query -loaded "MAYA85toNINJA"`                                   ||
				 `pluginInfo -query -loaded "MAYA2008 NINJA Exporter                        "` ||
				 `pluginInfo -query -loaded "MAYA2008toNINJA"`                                 ||
				 `pluginInfo -query -loaded "MAYA2009 NINJA Exporter                        "` );
	return $info;
}

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

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