Mobu:Motion文件Unity命名scheme

当导出采用Motionbuilder 2014中的几个fbx文件并使用File> Motion File Export …时 ,文件命名如下:

file_Take1.fbx

file_Take2.fbx

file_Take3.fbx

为了将运动文件正确加载到Unity中,我必须将它们重命名为:

file@Take1.fbx

file@Take2.fbx

file@Take3.fbx

必须用“@”代替下划线对于小型项目来说是好的,但是在处理大型项目中的许多工作时会花费很多时间。

有没有办法通过首选项或Python脚本更改MotionBuilder中的默认命名scheme,以便默认的下划线replace为“@”?

我设法在一些Python实验之后编写一个解决scheme。 为了使这个工作,将代码保存到一个python文件(.py),将文件放入Motionbuilder,然后单击执行。

如果您有兴趣,请input以下代码:

from pyfbsdk import * import os #save default name here for quick execution dName = "Untitled.fbx" lSystem = FBSystem() lApplication = FBApplication() lFileName = lApplication.FBXFileName FileDlg = FBFilePopup() FileDlg.Style = FBFilePopupStyle.kFBFilePopupSave FileDlg.Caption = "Saving Motion Files" FileDlg.FileName = dName FileDlg.Filter = "*.fbx" if FileDlg.Execute(): mSuccess = True lOptions = FBFbxOptions(False) lOriginalTake = lSystem.CurrentTake lFileNameText = os.path.splitext(FileDlg.FileName)[0]; lFileNameExt = os.path.splitext(FileDlg.FileName)[1] for lTake in lSystem.Scene.Takes: lSystem.CurrentTake = lTake lFullFileName = FileDlg.Path + '\\' + lFileNameText + '@' + lTake.Name + lFileNameExt; if lApplication.FileExport(lFullFileName) == False: mSuccess = False print lFullFileName + " Failed..."; else: print lFullFileName + " OK!"; lSystem.CurrentTake = lOriginalTake if mSuccess: print "Export successful!" else: print "Export failed." else: print "Export canceled."