QQ聊天

PythonSource - Maya

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")

  

posted @ 2011-08-26 22:21  SITT  阅读(422)  评论(0编辑  收藏  举报
QQ聊天