简体   繁体   中英

manager.GetIOSettings() -> None in Mac Python FBX SDK bindings

Fresh install of the python bindings for the FBX SDK on a Mac, into site-packages of an anaconda python 2.7.12 installation. Success when importing fbx and FbxCommon. Success creating manager, scene, and importer objects for an fbx file import. here's the code

import fbx

manager = fbx.FbxManager.Create()
iosettings = manager.GetIOSettings()
scene = fbx.FbxScene.Create(manager, "")
importer = fbx.FbxImporter.Create(manager, "")

fname = 'test.fbx'
if not importer.Initialize(fname, -1, iosettings):
    print "INITIALIZE ", importer.GetStatus().GetErrorString()
if not importer.Import(scene):
    print "IMPORT ", importer.GetStatus().GetErrorString()

But... manager.GetIOSettings() returns None rather than something usable. I am still able to import some files (others, with errors, are for another question), so maybe this is not a showstopper, but still...

Any ideas about iosettings?

If the manager does not have an IOSettings, you can create one for it:

if not manager.GetIOSettings():
    ios = fbx.FbxIOSettings.Create(manager, fbx.IOSROOT)
    manager.SetIOSettings(ios)

(discovered in the FbxCommon.py file from the python SDK bindings)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM