简体   繁体   English

manager.GetIOSettings()-> Mac Python FBX SDK绑定中没有

[英]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. 在Mac上,将FBX SDK的python绑定重新安装到anaconda python 2.7.12安装的站点包中。 Success when importing fbx and FbxCommon. 导入fbx和FbxCommon时成功。 Success creating manager, scene, and importer objects for an fbx file import. 成功创建用于fbx文件导入的管理器,场景和导入器对象。 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. 但是... manager.GetIOSettings()返回None而不是可用的东西。 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? 关于iosettings有什么想法吗?

If the manager does not have an IOSettings, you can create one for it: 如果管理器没有IOSettings,则可以为其创建一个:

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) (从python SDK绑定中的FbxCommon.py文件中发现)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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