亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? maya2ogre_export.mel

?? 赫赫大名的 OGRE 游戲引擎
?? MEL
字號:
/*
============================================================================
This source file is part of the Ogre-Maya Tools.
Distributed as part of Ogre (Object-oriented Graphics Rendering Engine).
Copyright (C) 2003 Fifty1 Software Inc.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
or go to http://www.gnu.org/licenses/gpl.txt
============================================================================
*/

namespace -add "maya2ogre";
namespace -set "maya2ogre";


// ===== Export
global proc ExportToOgre()
{
	saveFileInfo;
	
	// ===== Files and directories
	string $sceneFile    = `file -query -sceneName`;
	string $mayaFile     = basename($sceneFile, "");
	string $sceneDir     = toNativePath(dirname($sceneFile));
	string $baseFile     = basename($sceneFile, ".mb");
	string $outputDir    = toNativePath(`textField -query -text OutputDirectory`);
	string $meshFile     = toNativePath(`textField -query -text ExportMeshFilename`);
	string $materialFile = toNativePath(`textField -query -text ExportMaterialFilename`);
	string $skeletonFile = toNativePath(`textField -query -text ExportSkeletonFilename`);
	

	// ===== Make working copy of Maya file
	// (Removes need to save before exporting)
	string $mayaWorkingFile = `internalVar -userScriptDir` + "maya2ogre.mb";
	file -rename $mayaWorkingFile;
	file -save -force;
	file -rename $mayaFile;

	
	// ===== Options
	string $options = "";
	
	// --- Common params
	$options += " -in \"" + $mayaWorkingFile + "\"";
	string $materialPrefix = `textField -query -text MaterialPrefix`;
	if ($materialPrefix != "") 
	{
		$options += " -mprefix " + $materialPrefix;
	}
	
	// --- Mesh export
	int $exportMesh = `checkBox -query -value ExportMesh`;
	int $convertMesh = `checkBox -query -value ExportMeshBinary`;
	if ($exportMesh)
	{
		$options += " -mesh \"" + $outputDir + $meshFile + "\"";

		if (`checkBox -query -value ExportMeshVBA`)
		{
			$options += " -vba";
		}
		if (`checkBox -query -value ExportMeshNormals`)
		{
			$options += " -n";
		}
		if (`checkBox -query -value ExportMeshColours`)
		{
			$options += " -c";
		}
		if (`checkBox -query -value ExportMeshUVs`)
		{
			$options += " -t";
		}
	}
	
	// --- Material export
	int $exportMaterial = `checkBox -query -value ExportMaterial`;
	if ($exportMaterial)
	{
		$options += " -mat \"" + $outputDir + $materialFile + "\"";
	}

	// --- Skeleton/Animation export
	int $exportSkeleton = `checkBox -query -value ExportSkeleton`;
	int $convertSkeleton = `checkBox -query -value ExportSkeletonBinary`;
	if ($exportSkeleton)
	{
		$options += " -skel \"" + $outputDir + $skeletonFile + "\"";
		
		if (`checkBox -query -value ExportAnim`)
		{
			int $iAnim;
			string $animNameField;
			string $animStartField;
			string $animEndField;
			string $animStepField;

			for ($iAnim=1; $iAnim<=8; $iAnim++)
			{
				$animNameField  = "AnimName0"  + $iAnim;
				$animStartField = "AnimStart0" + $iAnim;
				$animEndField   = "AnimEnd0"   + $iAnim;
				$animStepField  = "AnimStep0"  + $iAnim;
				
				if (`textField -query -text $animNameField` != "")
				{
					$options += " -anim " + `textField -query -text $animNameField`;
					$options += " " + `intField -query -value $animStartField`;
					$options += " " + `intField -query -value $animEndField`;
					$options += " " + `intField -query -value $animStepField`;
				}
			}
		}
	}
	
	
	
	// ===== Export
	
	// --- Windows
	if (`about -windows`) 
	{
		string $commands;
		$commands += "rem ==================" + "\n";
		$commands += "rem Export to Ogre XML" + "\n";
		$commands += "rem ==================" + "\n";
		
		$commands += "set path=" + toNativePath(`internalVar -userScriptDir`) + ";%path%" + "\n";
		$commands += "pushd " + $sceneDir + "\n";
		$commands += "maya2ogre.exe " + $options + "\n";
		if ($exportMesh && $convertMesh) 
		{
			$commands += "rem ======================" + "\n";
			$commands += "rem Convert Mesh to Binary" + "\n";
			$commands += "rem ======================" + "\n";
			$commands += "pushd " + $outputDir + "\n";
			$commands += "OgreXMLConverter " + $meshFile + "\n";
			$commands += "popd" + "\n";
		}
		if ($exportSkeleton && $convertSkeleton) 
		{
			$commands += "rem ==========================" + "\n";
			$commands += "rem Convert Skeleton to Binary" + "\n";
			$commands += "rem ==========================" + "\n";
			$commands += "pushd " + $outputDir + "\n";
			$commands += "OgreXMLConverter " + $skeletonFile + "\n";
			$commands += "popd" + "\n";
		}
		$commands += "popd" + "\n";
		$commands += "pause" + "\n";
		
		string $commandFile = `internalVar -userScriptDir` + "maya2ogre_mel.bat";
		$fileID = `fopen $commandFile "w"`;
		fprint $fileID $commands;
		fclose $fileID;

		system("start \"" + `toNativePath $commandFile` + "\"");
	}
	
	// --- Linux
	else if (`about -linux`)
	{
		confirmDialog 
		   -title "Ogre Exporter"
		   -message "Sorry, but there is no command-line exporter or plug-in available for Linux yet. "
		   -button "Ok";
	}

	// --- Mac
	else if (`about -mac`)
	{
		confirmDialog 
		   -title "Ogre Exporter"
		   -message "Sorry, but there is no command-line exporter or plug-in available for Mac yet. ";
	}
	
}


// ===== Load preferences from fileInfo
// fileInfo is stored with Maya files so that export preferences
// are preserved with each source file.
global proc loadFileInfo()
{
	// Common parameters
	textField -edit -fileName `fileInfo -query "maya2ogre_outputDir"` OutputDirectory;
	textField -edit -text `fileInfo -query "maya2ogre_matPrefix"` MaterialPrefix;

	// Mesh
	string $valStrings[] = `fileInfo -query "maya2ogre_exportMesh"`;
	checkBox -edit -value `gmatch $valStrings[0] "1"` ExportMesh;

	string $valStrings[] = `fileInfo -query "maya2ogre_convertMesh"`;
	checkBox -edit -value `gmatch $valStrings[0] "1"` ExportMeshBinary;
	
	string $valStrings[] = `fileInfo -query "maya2ogre_exportMeshNormals"`;
	checkBox -edit -value `gmatch $valStrings[0] "1"` ExportMeshNormals;

	string $valStrings[] = `fileInfo -query "maya2ogre_exportMeshColours"`;
	checkBox -edit -value `gmatch $valStrings[0] "1"` ExportMeshColours;

	string $valStrings[] = `fileInfo -query "maya2ogre_exportMeshVBA"`;
	checkBox -edit -value `gmatch $valStrings[0] "1"` ExportMeshVBA;

	string $valStrings[] = `fileInfo -query "maya2ogre_exportMeshUVs"`;
	checkBox -edit -value `gmatch $valStrings[0] "1"` ExportMeshUVs;

	string $valStrings[] = `fileInfo -query "maya2ogre_exportMeshFile"`;
	if ($valStrings[0] != "") 
	{
		textField -edit -text `fileInfo -query "maya2ogre_exportMeshFile"` ExportMeshFilename;
	}
	
	// Material
	string $valStrings[] = `fileInfo -query "maya2ogre_exportMat"`;
	checkBox -edit -value `gmatch $valStrings[0] "1"` ExportMaterial;

	string $valStrings[] = `fileInfo -query "maya2ogre_exportMatFile"`;
	if ($valStrings[0] != "") 
	{
		textField -edit -text `fileInfo -query "maya2ogre_exportMatFile"` ExportMaterialFilename;
	}

	// Skeleton	
	string $valStrings[] = `fileInfo -query "maya2ogre_exportSkel"`;
	checkBox -edit -value `gmatch $valStrings[0] "1"` ExportSkeleton;

	string $valStrings[] = `fileInfo -query "maya2ogre_convertSkel"`;
	checkBox -edit -value `gmatch $valStrings[0] "1"` ExportSkeletonBinary;

	string $valStrings[] = `fileInfo -query "maya2ogre_exportSkelFile"`;
	if ($valStrings[0] != "") 
	{
		textField -edit -text `fileInfo -query "maya2ogre_exportSkelFile"` ExportSkeletonFilename;
	}
	
	// Animation
	string $valStrings[] = `fileInfo -query "maya2ogre_exportAnim"`;
	checkBox -edit -value `gmatch $valStrings[0] "1"` ExportAnim;

	int $iAnim;
	string $animNameField;
	string $animFileInfoKey;
	string $animFileInfoValue[];
	string $animStartField;
	string $animEndField;
	string $animStepField;
	for ($iAnim=1; $iAnim<=8; $iAnim++)
	{
		$animFileInfoKey = "maya2ogre_anim0" + $iAnim;
		$animNameField   = "AnimName0"  + $iAnim;
		$animStartField  = "AnimStart0" + $iAnim;
		$animEndField    = "AnimEnd0"   + $iAnim;
		$animStepField   = "AnimStep0"  + $iAnim;
		
		$animFileInfoValue = `fileInfo -query $animFileInfoKey`;
		string $animFileInfoDetails[];
		tokenize $animFileInfoValue[0] "," $animFileInfoDetails;
		
		string $animName = $animFileInfoDetails[0];
		if ($animName == "!") $animName = "";
		textField -edit -text $animName $animNameField;
		int $start = (int)$animFileInfoDetails[1];
		int $end   = (int)$animFileInfoDetails[2];
		int $step  = (int)$animFileInfoDetails[3];
		intField -edit -value $start $animStartField;
		intField -edit -value $end $animEndField;
		intField -edit -value $step $animStepField;
	}
}


// ===== Save preferences to fileInfo
global proc saveFileInfo()
{
	// Common parameters
	fileInfo "maya2ogre_outputDir" `textField -query -fileName OutputDirectory`;
	fileInfo "maya2ogre_matPrefix" `textField -query -text MaterialPrefix`;

	// Mesh
	fileInfo "maya2ogre_exportMesh" `checkBox -query -value ExportMesh`;
	fileInfo "maya2ogre_convertMesh" `checkBox -query -value ExportMeshBinary`; 
	fileInfo "maya2ogre_exportMeshNormals" `checkBox -query -value ExportMeshNormals`;
	fileInfo "maya2ogre_exportMeshColours" `checkBox -query -value ExportMeshColours`;
	fileInfo "maya2ogre_exportMeshVBA" `checkBox -query -value ExportMeshVBA`;
	fileInfo "maya2ogre_exportMeshUVs" `checkBox -query -value ExportMeshUVs`;
	fileInfo "maya2ogre_exportMeshFile" `textField -query -text ExportMeshFilename`;
	
	// Material
	fileInfo "maya2ogre_exportMat" `checkBox -query -value ExportMaterial`;
	fileInfo "maya2ogre_exportMatFile" `textField -query -text ExportMaterialFilename`;
	
	// Skeleton	
	fileInfo "maya2ogre_exportSkel" `checkBox -query -value ExportSkeleton`;
	fileInfo "maya2ogre_convertSkel" `checkBox -query -value ExportSkeletonBinary`; 
	fileInfo "maya2ogre_exportSkelFile" `textField -query -text ExportSkeletonFilename`;
	
	// Animation
	fileInfo "maya2ogre_exportAnim" `checkBox -query -value ExportAnim`;
	int $iAnim;
	string $animNameField;
	string $animFileInfoKey;
	string $animFileInfoValue;
	string $animStartField;
	string $animEndField;
	string $animStepField;
	for ($iAnim=1; $iAnim<=8; $iAnim++)
	{
		$animFileInfoKey = "maya2ogre_anim0" + $iAnim;
		$animNameField   = "AnimName0"  + $iAnim;
		$animStartField  = "AnimStart0" + $iAnim;
		$animEndField    = "AnimEnd0"   + $iAnim;
		$animStepField   = "AnimStep0"  + $iAnim;
		
		string $animName = `textField -query -text $animNameField`;
		if ($animName == "") $animName = "!";
		$animFileInfoValue = $animName;
		$animFileInfoValue += ", " + `intField -query -value $animStartField`;
		$animFileInfoValue += ", " + `intField -query -value $animEndField`;
		$animFileInfoValue += ", " + `intField -query -value $animStepField`;
		
		fileInfo $animFileInfoKey $animFileInfoValue;
	}
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩视频专区在线播放| 欧美精品久久天天躁| 91麻豆123| 免费在线看一区| 美女网站一区二区| 亚洲电影你懂得| 日韩高清一级片| 麻豆成人综合网| 国内精品不卡在线| 99久久综合精品| 91欧美激情一区二区三区成人| 丰满岳乱妇一区二区三区| 成人黄色av电影| 91精品啪在线观看国产60岁| 久久奇米777| 国产精品伦理在线| 亚洲一区电影777| 九一久久久久久| 欧美日韩在线播放| 欧美日韩精品系列| 欧美国产精品中文字幕| 樱花影视一区二区| 成人黄色小视频| 亚洲图片另类小说| 老司机免费视频一区二区三区| 在线免费亚洲电影| 成人永久aaa| 91亚洲男人天堂| 日本一区二区三区在线不卡| 美女在线视频一区| 91麻豆精品国产91久久久使用方法| 亚洲图片你懂的| av亚洲精华国产精华精| 国产丝袜在线精品| 成人午夜又粗又硬又大| 日本一区免费视频| 成人国产在线观看| 亚洲欧洲一区二区三区| 日本va欧美va瓶| 欧美卡1卡2卡| 99精品国产91久久久久久| 国产精品久久午夜夜伦鲁鲁| 成人爱爱电影网址| 中文字幕在线不卡一区二区三区| 成人永久免费视频| 亚洲精品成人悠悠色影视| 欧美午夜精品久久久久久超碰 | 久久久久97国产精华液好用吗| 久久se这里有精品| 91麻豆精品国产91久久久久| 久久狠狠亚洲综合| 亚洲人成电影网站色mp4| 在线观看视频欧美| 国产91丝袜在线播放九色| 亚洲视频免费观看| 日韩欧美国产精品| 色婷婷综合五月| 国产乱码精品一区二区三区忘忧草 | 国产成人精品免费| 图片区小说区国产精品视频| 精品国产自在久精品国产| 97久久精品人人做人人爽| 亚洲欧美日韩中文字幕一区二区三区 | 欧美日韩午夜在线| 黄色小说综合网站| 亚洲另类在线一区| 欧美精品一区二区三区四区| 日本道免费精品一区二区三区| 国产又黄又大久久| 亚洲成人午夜影院| 亚洲人成人一区二区在线观看| 欧美日韩久久久| 一本大道综合伊人精品热热| 狠狠色丁香久久婷婷综| 天天影视涩香欲综合网| 亚洲国产精品精华液ab| 欧美一级日韩不卡播放免费| 91福利视频久久久久| 欧美日韩一区高清| 色狠狠av一区二区三区| 成人18精品视频| 国产精品99久久久久久久女警| 伦理电影国产精品| 狠狠色丁香久久婷婷综| 国产一区二区视频在线| 国产米奇在线777精品观看| 精品无人码麻豆乱码1区2区 | 欧美国产乱子伦| 亚洲色图19p| 亚洲一二三区在线观看| 成人一区在线看| 99久久精品国产毛片| av在线不卡网| 日韩欧美一二区| 一二三区精品视频| 亚洲综合男人的天堂| 免费成人美女在线观看| 极品美女销魂一区二区三区免费| 国产九九视频一区二区三区| eeuss影院一区二区三区| 欧美日韩一区不卡| 久久亚洲二区三区| 伊人开心综合网| 久久99久国产精品黄毛片色诱| 色综合久久久久网| 国产欧美日韩精品a在线观看| 亚洲品质自拍视频网站| 国产成人免费在线视频| 欧美精品丝袜中出| 国产精品五月天| 热久久国产精品| 欧美色综合天天久久综合精品| 国产色综合久久| 美女久久久精品| 欧美日韩精品欧美日韩精品| 中文字幕+乱码+中文字幕一区| 免费欧美日韩国产三级电影| 欧美性猛交xxxx黑人交| ㊣最新国产の精品bt伙计久久| 国产精品一区在线| 国产视频一区在线播放| 国产一级精品在线| 26uuu国产一区二区三区| 激情综合亚洲精品| 精品国产一二三区| 国产黄色成人av| 国产午夜精品美女毛片视频| 国内精品视频一区二区三区八戒| 欧美一区二区三区在线看| 调教+趴+乳夹+国产+精品| 欧美精品丝袜中出| 国产在线一区二区综合免费视频| 欧美大黄免费观看| 精彩视频一区二区| 日韩成人精品在线| 精品国产污污免费网站入口 | 欧美军同video69gay| 免费在线看成人av| 久久久久久一级片| 9i看片成人免费高清| 午夜私人影院久久久久| 日韩欧美国产精品一区| 丁香一区二区三区| 午夜久久久久久久久| 欧美精品一区二区三区蜜桃视频 | 一区二区高清免费观看影视大全| 日韩小视频在线观看专区| 国产成人免费在线| 亚洲国产日韩av| 精品国产乱码久久久久久老虎| 97aⅴ精品视频一二三区| 婷婷中文字幕一区三区| 中文乱码免费一区二区| 4438x亚洲最大成人网| av成人动漫在线观看| 日韩不卡免费视频| 国产精品欧美一级免费| 精品久久久网站| 欧美日韩一卡二卡三卡| 色就色 综合激情| 精品一区二区三区免费播放| 午夜伦欧美伦电影理论片| 亚洲色欲色欲www| 国产无一区二区| 久久久精品国产免费观看同学| 欧美一区二区三区在线电影| 91香蕉视频mp4| 91一区二区三区在线播放| 懂色av一区二区三区蜜臀 | 久久久久久99精品| 精品免费视频.| 欧美激情资源网| 国产精品免费免费| 国产精品国产自产拍高清av王其| 久久亚洲精精品中文字幕早川悠里 | 综合电影一区二区三区 | 色婷婷综合中文久久一本| 色94色欧美sute亚洲线路一久| 色综合一区二区三区| 色诱视频网站一区| 欧美亚洲动漫另类| 日韩欧美亚洲国产另类| 欧美成人艳星乳罩| 久久精品亚洲精品国产欧美| 亚洲视频电影在线| 亚洲成人免费av| 国产麻豆视频一区| 91亚洲永久精品| 日韩女优电影在线观看| 中文字幕在线不卡视频| 日韩国产一区二| 成人h动漫精品一区二区 | 亚洲欧洲精品成人久久奇米网| 亚洲一区自拍偷拍| 黄页视频在线91| 欧美日韩亚洲国产综合| 欧美国产日本视频| 美女网站在线免费欧美精品| 色综合久久88色综合天天免费| 欧美一卡在线观看|