Tasks/BatchExportCharacterAnimationTool.py
15 from pyfbsdk
import FBFolderPopup, FBSystem, FBApplication, FBMessageBox, FBFbxOptions
21 lScene = lSystem.Scene
26 lFp.Caption =
"Source Files: Select the folder containing the files you would like to export"
29 lFp.Path =
r"C:\Autodesk"
36 FBMessageBox(
"Warning:",
"Selection canceled, cannot continue!",
"OK" )
39 FBMessageBox(
"Selected Folder Path:",
"Selected folder:\n Path: '%s'" % lFp.Path,
"OK" )
43 fileList = os.listdir(lFp.Path)
44 print "fileList", fileList
46 fbxRE = re.compile(
'^\w+.fbx$', re.I)
49 for fname
in fileList:
50 mo = fbxRE.search(fname)
57 lApp.FileOpen(lFp.Path +
"\\" + fname,
False)
63 lOptions.SaveCharacter =
False
64 lOptions.SaveControlSet =
True
65 lOptions.SaveCharacterExtension =
False
66 if len( lScene.Characters ) > 0:
67 lApp.SaveCharacterRigAndAnimation(lFp.Path +
"\\Animation_" + fname, lScene.Characters[0], lOptions)
72 del(lFp, FBFolderPopup, lSystem, FBSystem, lRes, lApp, FBApplication, lScene, fbxList, re, os, FBMessageBox, FBFbxOptions)