2012-05-14 73 views
-4

因此,我想要做的是更改引用(即文件C:/User/Desktop/file01/Cindi.ma)..我將如何使用Python代碼將該引用更改爲C: /User/Desktop/file02/Cindi.ma?任何幫助讚賞瑪雅/ Python協助!任何熟悉Maya API的人?

+4

顯示您的代碼。看看這個:http://sscce.org/。您還需要更改爲更具描述性的標題,以獲得更多回復。 – Marcin

回答

1
import maya.cmds as mc 

#First query the reference node name to replace reference. 
rfn = mc.file("C:/User/Desktop/file01/Cindi.ma", q=1, rfn=1) 

#then use reference node name(rfn) to replace the path. 
mc.file ("C:/User/Desktop/file02/Cindi.ma", loadReference=rfn, type="mayaAscii", options="v=0")