Tasks/RenameFirstTakeOnMultipleFiles.py
8 from pyfbsdk
import FBApplication, FBSystem, FBFolderPopup
17 lFolderPopup.Caption =
"Select the folder where all the FBX files are located"
19 if lFolderPopup.Execute():
20 lFileList = listdir( lFolderPopup.Path )
22 for lFile
in lFileList:
23 if lFile.endswith(
'.fbx' ):
25 lFileFullPath =
"%s\\%s" % ( lFolderPopup.Path, lFile )
28 print"Message: Opening file '%s'" % lFileFullPath
29 lApplication.FileOpen( lFileFullPath )
33 lName = lFile.replace(
".fbx",
"" )
38 print "Message: Renaming take '%s' to '%s'" % ( lSystem.Scene.Takes[0].Name, lName )
39 lSystem.Scene.Takes[0].Name = lName
43 print "Message: Saving file '%s'\n" % lFileFullPath
44 lApplication.FileSave( lFileFullPath )
47 lApplication.FileNew()
50 del( lName, lFileFullPath )
53 del( lFileList, lFile )
58 del( FBApplication, FBSystem, FBFolderPopup )
64 del( lApplication, lSystem, lFolderPopup )