现在的位置: 首页 > 综合 > 正文

PythonSource – Maya

2012年01月20日 ⁄ 综合 ⁄ 共 347字 ⁄ 字号 评论关闭

Maya的Python竟然没有Mel中的source函数,就自己写了个。

PythonSource

global proc PythonSource(string $inputFileName) 
{
$fileId
=fopen($inputFileName,"r");
string $fileDetails = "";
string $nextLine = "";
do
{
$nextLine
= `fgetline $fileId`;
$fileDetails
+= $nextLine;
}
while ( size( $nextLine ) > 0 );
fclose $fileId;
python($fileDetails );
}

  

然后悲催的发现,python中已经有这样的函数了

execfile("D:\\UniqueTransform.py")

  

抱歉!评论已关闭.