导出物体数值代码(驱动镜像以及拷贝时候很好用的,配合导入代码使用),回头我会添加一个UI
import maya.cmds as mc
import os
File_NAme='L_arm_ft_60_drvNumber.txt'
File_save_path=r'E:\temp'
mySaveFinalFile=File_save_path+'\\'+File_NAme
if os.path.exists(mySaveFinalFile)==True:
os.remove(mySaveFinalFile)
myallCtrlSel=mc.ls(sl=True)
for a in range(len(myallCtrlSel)):
myAttr=mc.listAttr(myallCtrlSel,k=True)
#print myAttr
if myAttr!=None:
for b in range(len(myAttr)):
myExprAttr=myallCtrlSel[a]+'.'+myAttr[b]
myAttrNm=float(mc.getAttr(myExprAttr))
myneedWrite=("@"+str(myallCtrlSel[a])+"&"+str(myAttr[b])+":"+str(myAttrNm)+'\r\n')
f=file(mySaveFinalFile,'a')
f.write(myneedWrite)
f.close()
欢迎交流
VX:27971533