├── Python37_x64 ├── fbx.pyd ├── fbxsip.pyd └── FbxCommon.py ├── maya_27 └── fbx │ ├── fbx.pyd │ ├── fbxsip.pyd │ └── FbxCommon.py ├── maya_37 └── fbx │ ├── fbx.pyd │ ├── fbxsip.pyd │ └── FbxCommon.py ├── maya_39 └── fbx │ ├── fbx.pyd │ ├── fbxsip.pyd │ └── FbxCommon.py ├── Python27_x64 └── fbx │ ├── fbx.pyd │ ├── fbxsip.pyd │ └── FbxCommon.py ├── Python310_x64 └── fbx │ ├── fbx.pyd │ ├── fbxsip.pyd │ └── FbxCommon.py ├── Python39_x64 └── fbx │ ├── fbx.pyd │ ├── fbxsip.pyd │ └── FbxCommon.py └── README.md /Python37_x64/fbx.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3DTech-Steven7/python-fbx/HEAD/Python37_x64/fbx.pyd -------------------------------------------------------------------------------- /maya_27/fbx/fbx.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3DTech-Steven7/python-fbx/HEAD/maya_27/fbx/fbx.pyd -------------------------------------------------------------------------------- /maya_37/fbx/fbx.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3DTech-Steven7/python-fbx/HEAD/maya_37/fbx/fbx.pyd -------------------------------------------------------------------------------- /maya_39/fbx/fbx.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3DTech-Steven7/python-fbx/HEAD/maya_39/fbx/fbx.pyd -------------------------------------------------------------------------------- /Python37_x64/fbxsip.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3DTech-Steven7/python-fbx/HEAD/Python37_x64/fbxsip.pyd -------------------------------------------------------------------------------- /maya_27/fbx/fbxsip.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3DTech-Steven7/python-fbx/HEAD/maya_27/fbx/fbxsip.pyd -------------------------------------------------------------------------------- /maya_37/fbx/fbxsip.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3DTech-Steven7/python-fbx/HEAD/maya_37/fbx/fbxsip.pyd -------------------------------------------------------------------------------- /maya_39/fbx/fbxsip.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3DTech-Steven7/python-fbx/HEAD/maya_39/fbx/fbxsip.pyd -------------------------------------------------------------------------------- /Python27_x64/fbx/fbx.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3DTech-Steven7/python-fbx/HEAD/Python27_x64/fbx/fbx.pyd -------------------------------------------------------------------------------- /Python310_x64/fbx/fbx.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3DTech-Steven7/python-fbx/HEAD/Python310_x64/fbx/fbx.pyd -------------------------------------------------------------------------------- /Python39_x64/fbx/fbx.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3DTech-Steven7/python-fbx/HEAD/Python39_x64/fbx/fbx.pyd -------------------------------------------------------------------------------- /Python27_x64/fbx/fbxsip.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3DTech-Steven7/python-fbx/HEAD/Python27_x64/fbx/fbxsip.pyd -------------------------------------------------------------------------------- /Python310_x64/fbx/fbxsip.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3DTech-Steven7/python-fbx/HEAD/Python310_x64/fbx/fbxsip.pyd -------------------------------------------------------------------------------- /Python39_x64/fbx/fbxsip.pyd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/3DTech-Steven7/python-fbx/HEAD/Python39_x64/fbx/fbxsip.pyd -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # python-fbx 2 | python-fbx 3 | 4 | Supported versions Python2.7, Python3.7, Python3.9, Python3.10, Maya-Python2.7, Maya-Python3.7, Maya-Python3.9 5 | -------------------------------------------------------------------------------- /Python37_x64/FbxCommon.py: -------------------------------------------------------------------------------- 1 | from fbx import * 2 | import sys 3 | 4 | def InitializeSdkObjects(): 5 | # The first thing to do is to create the FBX SDK manager which is the 6 | # object allocator for almost all the classes in the SDK. 7 | lSdkManager = FbxManager.Create() 8 | if not lSdkManager: 9 | sys.exit(0) 10 | 11 | # Create an IOSettings object 12 | ios = FbxIOSettings.Create(lSdkManager, IOSROOT) 13 | lSdkManager.SetIOSettings(ios) 14 | 15 | # Create the entity that will hold the scene. 16 | lScene = FbxScene.Create(lSdkManager, "") 17 | 18 | return (lSdkManager, lScene) 19 | 20 | def SaveScene(pSdkManager, pScene, pFilename, pFileFormat = -1, pEmbedMedia = False): 21 | lExporter = FbxExporter.Create(pSdkManager, "") 22 | if pFileFormat < 0 or pFileFormat >= pSdkManager.GetIOPluginRegistry().GetWriterFormatCount(): 23 | pFileFormat = pSdkManager.GetIOPluginRegistry().GetNativeWriterFormat() 24 | if not pEmbedMedia: 25 | lFormatCount = pSdkManager.GetIOPluginRegistry().GetWriterFormatCount() 26 | for lFormatIndex in range(lFormatCount): 27 | if pSdkManager.GetIOPluginRegistry().WriterIsFBX(lFormatIndex): 28 | lDesc = pSdkManager.GetIOPluginRegistry().GetWriterFormatDescription(lFormatIndex) 29 | if "ascii" in lDesc: 30 | pFileFormat = lFormatIndex 31 | break 32 | 33 | if not pSdkManager.GetIOSettings(): 34 | ios = FbxIOSettings.Create(pSdkManager, IOSROOT) 35 | pSdkManager.SetIOSettings(ios) 36 | 37 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_MATERIAL, True) 38 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_TEXTURE, True) 39 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_EMBEDDED, pEmbedMedia) 40 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_SHAPE, True) 41 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GOBO, True) 42 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_ANIMATION, True) 43 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GLOBAL_SETTINGS, True) 44 | 45 | result = lExporter.Initialize(pFilename, pFileFormat, pSdkManager.GetIOSettings()) 46 | if result == True: 47 | result = lExporter.Export(pScene) 48 | 49 | lExporter.Destroy() 50 | return result 51 | 52 | def LoadScene(pSdkManager, pScene, pFileName): 53 | lImporter = FbxImporter.Create(pSdkManager, "") 54 | result = lImporter.Initialize(pFileName, -1, pSdkManager.GetIOSettings()) 55 | if not result: 56 | return False 57 | 58 | if lImporter.IsFBX(): 59 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_MATERIAL, True) 60 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_TEXTURE, True) 61 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_EMBEDDED, True) 62 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_SHAPE, True) 63 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GOBO, True) 64 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_ANIMATION, True) 65 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GLOBAL_SETTINGS, True) 66 | 67 | result = lImporter.Import(pScene) 68 | lImporter.Destroy() 69 | return result 70 | -------------------------------------------------------------------------------- /maya_27/fbx/FbxCommon.py: -------------------------------------------------------------------------------- 1 | from fbx import * 2 | import sys 3 | 4 | def InitializeSdkObjects(): 5 | # The first thing to do is to create the FBX SDK manager which is the 6 | # object allocator for almost all the classes in the SDK. 7 | lSdkManager = FbxManager.Create() 8 | if not lSdkManager: 9 | sys.exit(0) 10 | 11 | # Create an IOSettings object 12 | ios = FbxIOSettings.Create(lSdkManager, IOSROOT) 13 | lSdkManager.SetIOSettings(ios) 14 | 15 | # Create the entity that will hold the scene. 16 | lScene = FbxScene.Create(lSdkManager, "") 17 | 18 | return (lSdkManager, lScene) 19 | 20 | def SaveScene(pSdkManager, pScene, pFilename, pFileFormat = -1, pEmbedMedia = False): 21 | lExporter = FbxExporter.Create(pSdkManager, "") 22 | if pFileFormat < 0 or pFileFormat >= pSdkManager.GetIOPluginRegistry().GetWriterFormatCount(): 23 | pFileFormat = pSdkManager.GetIOPluginRegistry().GetNativeWriterFormat() 24 | if not pEmbedMedia: 25 | lFormatCount = pSdkManager.GetIOPluginRegistry().GetWriterFormatCount() 26 | for lFormatIndex in range(lFormatCount): 27 | if pSdkManager.GetIOPluginRegistry().WriterIsFBX(lFormatIndex): 28 | lDesc = pSdkManager.GetIOPluginRegistry().GetWriterFormatDescription(lFormatIndex) 29 | if "ascii" in lDesc: 30 | pFileFormat = lFormatIndex 31 | break 32 | 33 | if not pSdkManager.GetIOSettings(): 34 | ios = FbxIOSettings.Create(pSdkManager, IOSROOT) 35 | pSdkManager.SetIOSettings(ios) 36 | 37 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_MATERIAL, True) 38 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_TEXTURE, True) 39 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_EMBEDDED, pEmbedMedia) 40 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_SHAPE, True) 41 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GOBO, True) 42 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_ANIMATION, True) 43 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GLOBAL_SETTINGS, True) 44 | 45 | result = lExporter.Initialize(pFilename, pFileFormat, pSdkManager.GetIOSettings()) 46 | if result == True: 47 | result = lExporter.Export(pScene) 48 | 49 | lExporter.Destroy() 50 | return result 51 | 52 | def LoadScene(pSdkManager, pScene, pFileName): 53 | lImporter = FbxImporter.Create(pSdkManager, "") 54 | result = lImporter.Initialize(pFileName, -1, pSdkManager.GetIOSettings()) 55 | if not result: 56 | return False 57 | 58 | if lImporter.IsFBX(): 59 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_MATERIAL, True) 60 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_TEXTURE, True) 61 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_EMBEDDED, True) 62 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_SHAPE, True) 63 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GOBO, True) 64 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_ANIMATION, True) 65 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GLOBAL_SETTINGS, True) 66 | 67 | result = lImporter.Import(pScene) 68 | lImporter.Destroy() 69 | return result 70 | -------------------------------------------------------------------------------- /maya_37/fbx/FbxCommon.py: -------------------------------------------------------------------------------- 1 | from fbx import * 2 | import sys 3 | 4 | def InitializeSdkObjects(): 5 | # The first thing to do is to create the FBX SDK manager which is the 6 | # object allocator for almost all the classes in the SDK. 7 | lSdkManager = FbxManager.Create() 8 | if not lSdkManager: 9 | sys.exit(0) 10 | 11 | # Create an IOSettings object 12 | ios = FbxIOSettings.Create(lSdkManager, IOSROOT) 13 | lSdkManager.SetIOSettings(ios) 14 | 15 | # Create the entity that will hold the scene. 16 | lScene = FbxScene.Create(lSdkManager, "") 17 | 18 | return (lSdkManager, lScene) 19 | 20 | def SaveScene(pSdkManager, pScene, pFilename, pFileFormat = -1, pEmbedMedia = False): 21 | lExporter = FbxExporter.Create(pSdkManager, "") 22 | if pFileFormat < 0 or pFileFormat >= pSdkManager.GetIOPluginRegistry().GetWriterFormatCount(): 23 | pFileFormat = pSdkManager.GetIOPluginRegistry().GetNativeWriterFormat() 24 | if not pEmbedMedia: 25 | lFormatCount = pSdkManager.GetIOPluginRegistry().GetWriterFormatCount() 26 | for lFormatIndex in range(lFormatCount): 27 | if pSdkManager.GetIOPluginRegistry().WriterIsFBX(lFormatIndex): 28 | lDesc = pSdkManager.GetIOPluginRegistry().GetWriterFormatDescription(lFormatIndex) 29 | if "ascii" in lDesc: 30 | pFileFormat = lFormatIndex 31 | break 32 | 33 | if not pSdkManager.GetIOSettings(): 34 | ios = FbxIOSettings.Create(pSdkManager, IOSROOT) 35 | pSdkManager.SetIOSettings(ios) 36 | 37 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_MATERIAL, True) 38 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_TEXTURE, True) 39 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_EMBEDDED, pEmbedMedia) 40 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_SHAPE, True) 41 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GOBO, True) 42 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_ANIMATION, True) 43 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GLOBAL_SETTINGS, True) 44 | 45 | result = lExporter.Initialize(pFilename, pFileFormat, pSdkManager.GetIOSettings()) 46 | if result == True: 47 | result = lExporter.Export(pScene) 48 | 49 | lExporter.Destroy() 50 | return result 51 | 52 | def LoadScene(pSdkManager, pScene, pFileName): 53 | lImporter = FbxImporter.Create(pSdkManager, "") 54 | result = lImporter.Initialize(pFileName, -1, pSdkManager.GetIOSettings()) 55 | if not result: 56 | return False 57 | 58 | if lImporter.IsFBX(): 59 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_MATERIAL, True) 60 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_TEXTURE, True) 61 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_EMBEDDED, True) 62 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_SHAPE, True) 63 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GOBO, True) 64 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_ANIMATION, True) 65 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GLOBAL_SETTINGS, True) 66 | 67 | result = lImporter.Import(pScene) 68 | lImporter.Destroy() 69 | return result 70 | -------------------------------------------------------------------------------- /maya_39/fbx/FbxCommon.py: -------------------------------------------------------------------------------- 1 | from fbx import * 2 | import sys 3 | 4 | def InitializeSdkObjects(): 5 | # The first thing to do is to create the FBX SDK manager which is the 6 | # object allocator for almost all the classes in the SDK. 7 | lSdkManager = FbxManager.Create() 8 | if not lSdkManager: 9 | sys.exit(0) 10 | 11 | # Create an IOSettings object 12 | ios = FbxIOSettings.Create(lSdkManager, IOSROOT) 13 | lSdkManager.SetIOSettings(ios) 14 | 15 | # Create the entity that will hold the scene. 16 | lScene = FbxScene.Create(lSdkManager, "") 17 | 18 | return (lSdkManager, lScene) 19 | 20 | def SaveScene(pSdkManager, pScene, pFilename, pFileFormat = -1, pEmbedMedia = False): 21 | lExporter = FbxExporter.Create(pSdkManager, "") 22 | if pFileFormat < 0 or pFileFormat >= pSdkManager.GetIOPluginRegistry().GetWriterFormatCount(): 23 | pFileFormat = pSdkManager.GetIOPluginRegistry().GetNativeWriterFormat() 24 | if not pEmbedMedia: 25 | lFormatCount = pSdkManager.GetIOPluginRegistry().GetWriterFormatCount() 26 | for lFormatIndex in range(lFormatCount): 27 | if pSdkManager.GetIOPluginRegistry().WriterIsFBX(lFormatIndex): 28 | lDesc = pSdkManager.GetIOPluginRegistry().GetWriterFormatDescription(lFormatIndex) 29 | if "ascii" in lDesc: 30 | pFileFormat = lFormatIndex 31 | break 32 | 33 | if not pSdkManager.GetIOSettings(): 34 | ios = FbxIOSettings.Create(pSdkManager, IOSROOT) 35 | pSdkManager.SetIOSettings(ios) 36 | 37 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_MATERIAL, True) 38 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_TEXTURE, True) 39 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_EMBEDDED, pEmbedMedia) 40 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_SHAPE, True) 41 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GOBO, True) 42 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_ANIMATION, True) 43 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GLOBAL_SETTINGS, True) 44 | 45 | result = lExporter.Initialize(pFilename, pFileFormat, pSdkManager.GetIOSettings()) 46 | if result == True: 47 | result = lExporter.Export(pScene) 48 | 49 | lExporter.Destroy() 50 | return result 51 | 52 | def LoadScene(pSdkManager, pScene, pFileName): 53 | lImporter = FbxImporter.Create(pSdkManager, "") 54 | result = lImporter.Initialize(pFileName, -1, pSdkManager.GetIOSettings()) 55 | if not result: 56 | return False 57 | 58 | if lImporter.IsFBX(): 59 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_MATERIAL, True) 60 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_TEXTURE, True) 61 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_EMBEDDED, True) 62 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_SHAPE, True) 63 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GOBO, True) 64 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_ANIMATION, True) 65 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GLOBAL_SETTINGS, True) 66 | 67 | result = lImporter.Import(pScene) 68 | lImporter.Destroy() 69 | return result 70 | -------------------------------------------------------------------------------- /Python27_x64/fbx/FbxCommon.py: -------------------------------------------------------------------------------- 1 | from fbx import * 2 | import sys 3 | 4 | def InitializeSdkObjects(): 5 | # The first thing to do is to create the FBX SDK manager which is the 6 | # object allocator for almost all the classes in the SDK. 7 | lSdkManager = FbxManager.Create() 8 | if not lSdkManager: 9 | sys.exit(0) 10 | 11 | # Create an IOSettings object 12 | ios = FbxIOSettings.Create(lSdkManager, IOSROOT) 13 | lSdkManager.SetIOSettings(ios) 14 | 15 | # Create the entity that will hold the scene. 16 | lScene = FbxScene.Create(lSdkManager, "") 17 | 18 | return (lSdkManager, lScene) 19 | 20 | def SaveScene(pSdkManager, pScene, pFilename, pFileFormat = -1, pEmbedMedia = False): 21 | lExporter = FbxExporter.Create(pSdkManager, "") 22 | if pFileFormat < 0 or pFileFormat >= pSdkManager.GetIOPluginRegistry().GetWriterFormatCount(): 23 | pFileFormat = pSdkManager.GetIOPluginRegistry().GetNativeWriterFormat() 24 | if not pEmbedMedia: 25 | lFormatCount = pSdkManager.GetIOPluginRegistry().GetWriterFormatCount() 26 | for lFormatIndex in range(lFormatCount): 27 | if pSdkManager.GetIOPluginRegistry().WriterIsFBX(lFormatIndex): 28 | lDesc = pSdkManager.GetIOPluginRegistry().GetWriterFormatDescription(lFormatIndex) 29 | if "ascii" in lDesc: 30 | pFileFormat = lFormatIndex 31 | break 32 | 33 | if not pSdkManager.GetIOSettings(): 34 | ios = FbxIOSettings.Create(pSdkManager, IOSROOT) 35 | pSdkManager.SetIOSettings(ios) 36 | 37 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_MATERIAL, True) 38 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_TEXTURE, True) 39 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_EMBEDDED, pEmbedMedia) 40 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_SHAPE, True) 41 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GOBO, True) 42 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_ANIMATION, True) 43 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GLOBAL_SETTINGS, True) 44 | 45 | result = lExporter.Initialize(pFilename, pFileFormat, pSdkManager.GetIOSettings()) 46 | if result == True: 47 | result = lExporter.Export(pScene) 48 | 49 | lExporter.Destroy() 50 | return result 51 | 52 | def LoadScene(pSdkManager, pScene, pFileName): 53 | lImporter = FbxImporter.Create(pSdkManager, "") 54 | result = lImporter.Initialize(pFileName, -1, pSdkManager.GetIOSettings()) 55 | if not result: 56 | return False 57 | 58 | if lImporter.IsFBX(): 59 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_MATERIAL, True) 60 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_TEXTURE, True) 61 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_EMBEDDED, True) 62 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_SHAPE, True) 63 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GOBO, True) 64 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_ANIMATION, True) 65 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GLOBAL_SETTINGS, True) 66 | 67 | result = lImporter.Import(pScene) 68 | lImporter.Destroy() 69 | return result 70 | -------------------------------------------------------------------------------- /Python310_x64/fbx/FbxCommon.py: -------------------------------------------------------------------------------- 1 | from fbx import * 2 | import sys 3 | 4 | def InitializeSdkObjects(): 5 | # The first thing to do is to create the FBX SDK manager which is the 6 | # object allocator for almost all the classes in the SDK. 7 | lSdkManager = FbxManager.Create() 8 | if not lSdkManager: 9 | sys.exit(0) 10 | 11 | # Create an IOSettings object 12 | ios = FbxIOSettings.Create(lSdkManager, IOSROOT) 13 | lSdkManager.SetIOSettings(ios) 14 | 15 | # Create the entity that will hold the scene. 16 | lScene = FbxScene.Create(lSdkManager, "") 17 | 18 | return (lSdkManager, lScene) 19 | 20 | def SaveScene(pSdkManager, pScene, pFilename, pFileFormat = -1, pEmbedMedia = False): 21 | lExporter = FbxExporter.Create(pSdkManager, "") 22 | if pFileFormat < 0 or pFileFormat >= pSdkManager.GetIOPluginRegistry().GetWriterFormatCount(): 23 | pFileFormat = pSdkManager.GetIOPluginRegistry().GetNativeWriterFormat() 24 | if not pEmbedMedia: 25 | lFormatCount = pSdkManager.GetIOPluginRegistry().GetWriterFormatCount() 26 | for lFormatIndex in range(lFormatCount): 27 | if pSdkManager.GetIOPluginRegistry().WriterIsFBX(lFormatIndex): 28 | lDesc = pSdkManager.GetIOPluginRegistry().GetWriterFormatDescription(lFormatIndex) 29 | if "ascii" in lDesc: 30 | pFileFormat = lFormatIndex 31 | break 32 | 33 | if not pSdkManager.GetIOSettings(): 34 | ios = FbxIOSettings.Create(pSdkManager, IOSROOT) 35 | pSdkManager.SetIOSettings(ios) 36 | 37 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_MATERIAL, True) 38 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_TEXTURE, True) 39 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_EMBEDDED, pEmbedMedia) 40 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_SHAPE, True) 41 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GOBO, True) 42 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_ANIMATION, True) 43 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GLOBAL_SETTINGS, True) 44 | 45 | result = lExporter.Initialize(pFilename, pFileFormat, pSdkManager.GetIOSettings()) 46 | if result == True: 47 | result = lExporter.Export(pScene) 48 | 49 | lExporter.Destroy() 50 | return result 51 | 52 | def LoadScene(pSdkManager, pScene, pFileName): 53 | lImporter = FbxImporter.Create(pSdkManager, "") 54 | result = lImporter.Initialize(pFileName, -1, pSdkManager.GetIOSettings()) 55 | if not result: 56 | return False 57 | 58 | if lImporter.IsFBX(): 59 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_MATERIAL, True) 60 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_TEXTURE, True) 61 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_EMBEDDED, True) 62 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_SHAPE, True) 63 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GOBO, True) 64 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_ANIMATION, True) 65 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GLOBAL_SETTINGS, True) 66 | 67 | result = lImporter.Import(pScene) 68 | lImporter.Destroy() 69 | return result 70 | -------------------------------------------------------------------------------- /Python39_x64/fbx/FbxCommon.py: -------------------------------------------------------------------------------- 1 | from fbx import * 2 | import sys 3 | 4 | def InitializeSdkObjects(): 5 | # The first thing to do is to create the FBX SDK manager which is the 6 | # object allocator for almost all the classes in the SDK. 7 | lSdkManager = FbxManager.Create() 8 | if not lSdkManager: 9 | sys.exit(0) 10 | 11 | # Create an IOSettings object 12 | ios = FbxIOSettings.Create(lSdkManager, IOSROOT) 13 | lSdkManager.SetIOSettings(ios) 14 | 15 | # Create the entity that will hold the scene. 16 | lScene = FbxScene.Create(lSdkManager, "") 17 | 18 | return (lSdkManager, lScene) 19 | 20 | def SaveScene(pSdkManager, pScene, pFilename, pFileFormat = -1, pEmbedMedia = False): 21 | lExporter = FbxExporter.Create(pSdkManager, "") 22 | if pFileFormat < 0 or pFileFormat >= pSdkManager.GetIOPluginRegistry().GetWriterFormatCount(): 23 | pFileFormat = pSdkManager.GetIOPluginRegistry().GetNativeWriterFormat() 24 | if not pEmbedMedia: 25 | lFormatCount = pSdkManager.GetIOPluginRegistry().GetWriterFormatCount() 26 | for lFormatIndex in range(lFormatCount): 27 | if pSdkManager.GetIOPluginRegistry().WriterIsFBX(lFormatIndex): 28 | lDesc = pSdkManager.GetIOPluginRegistry().GetWriterFormatDescription(lFormatIndex) 29 | if "ascii" in lDesc: 30 | pFileFormat = lFormatIndex 31 | break 32 | 33 | if not pSdkManager.GetIOSettings(): 34 | ios = FbxIOSettings.Create(pSdkManager, IOSROOT) 35 | pSdkManager.SetIOSettings(ios) 36 | 37 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_MATERIAL, True) 38 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_TEXTURE, True) 39 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_EMBEDDED, pEmbedMedia) 40 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_SHAPE, True) 41 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GOBO, True) 42 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_ANIMATION, True) 43 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GLOBAL_SETTINGS, True) 44 | 45 | result = lExporter.Initialize(pFilename, pFileFormat, pSdkManager.GetIOSettings()) 46 | if result == True: 47 | result = lExporter.Export(pScene) 48 | 49 | lExporter.Destroy() 50 | return result 51 | 52 | def LoadScene(pSdkManager, pScene, pFileName): 53 | lImporter = FbxImporter.Create(pSdkManager, "") 54 | result = lImporter.Initialize(pFileName, -1, pSdkManager.GetIOSettings()) 55 | if not result: 56 | return False 57 | 58 | if lImporter.IsFBX(): 59 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_MATERIAL, True) 60 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_TEXTURE, True) 61 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_EMBEDDED, True) 62 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_SHAPE, True) 63 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GOBO, True) 64 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_ANIMATION, True) 65 | pSdkManager.GetIOSettings().SetBoolProp(EXP_FBX_GLOBAL_SETTINGS, True) 66 | 67 | result = lImporter.Import(pScene) 68 | lImporter.Destroy() 69 | return result 70 | --------------------------------------------------------------------------------