Python SDK: GetTakeInfo Error

Python SDK: GetTakeInfo Error

Anonymous
Not applicable
709 Views
2 Replies
Message 1 of 3

Python SDK: GetTakeInfo Error

Anonymous
Not applicable

I load a single layer animation fbx like this:

from FbxCommon import *
def GetFrameData_FBX(path: str):
    manager, scene = InitializeSdkObjects()
    result = LoadScene(manager, scene, path)
    if not result:
        raise IOError('FBX scene not loading')
    mode = scene.GetGlobalSettings().GetTimeMode()
    stack = scene.GetCurrentAnimationStack()
    name = stack.GetName()
    info = scene.GetTakeInfo(name)

and I get the following error:

AttributeError: 'FbxScene' object has no attribute 'GetTakeInfo'

 Double checking the API, I see that this is a public member function inherited from FbxDocument. So what the hell gives?!! All y'all need to seriously write better documentation, this has to be one of the worst sets of docos I've ever seen...and that includes open source. 

0 Likes
710 Views
2 Replies
Replies (2)
Message 2 of 3

regalir
Autodesk
Autodesk

Hi,

The FBX Python bindings was never developed to implement the whole C++ interfaces and some functionality do not have their Python equivalent. However,

 

a) most of the information stored in the FbxTakeInfo is available in the FbxAnimStack

b) you can get an FbxTakeInfo object from the FbxImporter object

 

BTW, the FbxImporter is "hidden" inside the LoadFile() function that is defined in FbxCommon.py in the lib folder. If you absolutely want to get an FbxTakeInfo, you should probably re-write your own LoadFile() function so you have the full access to the FbxImporter object.

0 Likes
Message 3 of 3

738746223
Contributor
Contributor

for i in range(self.scene.GetSrcObjectCount(FbxCriteria.ObjectType(FbxAnimStack.ClassId))):
# Take 001 遍历 take
lAnimStack = self.scene.GetSrcObject(FbxCriteria.ObjectType(FbxAnimStack.ClassId), i)
print("Take: %s" % lAnimStack.GetName())

 

https://blog.csdn.net/to4698/article/details/112995602

0 Likes