1
2
3
4
5
6
7
8from pyfbsdk import FBApplication, FBSystem, FBFolderPopup
9from os import listdir
10
11
14
15
17lFolderPopup.Caption = "Select the folder where all the FBX files are located"
18
19if lFolderPopup.Execute():
20 lFileList = listdir( lFolderPopup.Path )
21
22 for lFile in lFileList:
23 if lFile.endswith( '.fbx' ):
24
25 lFileFullPath = "%s\\%s" % ( lFolderPopup.Path, lFile )
26
27
28 print("Message: Opening file '%s'" % lFileFullPath)
29 lApplication.FileOpen( lFileFullPath )
30
31
32
33 lName = lFile.replace( ".fbx", "" )
34
35
36
37
38 print("Message: Renaming take '%s' to '%s'" % ( lSystem.Scene.Takes[0].Name, lName ))
39 lSystem.Scene.Takes[0].Name = lName
40
41
42
43 print("Message: Saving file '%s'\n" % lFileFullPath)
44 lApplication.FileSave( lFileFullPath )
45
46
47 lApplication.FileNew()
48
49
50 del( lName, lFileFullPath )
51
52
53 del( lFileList, lFile )
54
55
56
57
58del( FBApplication, FBSystem, FBFolderPopup )
59
60
61del( listdir )
62
63
64del( lApplication, lSystem, lFolderPopup )
FBApplication is used mainly to manage files.
Definition: pyfbsdk_generated.h:801
Provides access to the underlying system, and the MotionBuilder scene.
Definition: pyfbsdk_generated.h:18771