FBX SDK - Get the FbxNode from an ENodeId of a Character


#1

Is it possible to get the associated [B]FbxNode[/B] from the enum ENodeId ?
for example if i want to get the FbxNode from the [B]Character::eLeftHand[/B]

I tried to use [B]Character::GetCharacterLink(ENodeId, FbxCharacterLink)[/B]
then extracting the FbxNode from [B]FbxCharacterLink[/B] simply by calling [B]FbxCharacterLink::mNode[/B]

However this function returns for most ENodeIds False, so no FbxCharacterLink is created.

    character = myScene.GetCharacter(0)
    lefthand = character.eLeftHand
    lefthand_node = FbxCharacterLink()
    character.GetCharacterLink(lefthand, lefthand_node) # False
    lefthand_node = lefthand_node.mNode

when I was scripting inside Motionbuilder using Python and [B]Pyfbxsdk[/B], it was very easy, no matter how the skeleton objects are named, I can get the [B]FBXObject[/B] of it

    m = character.GetModel(self.BodyNodeObject[o])

and [B][I]BodyNodeObject[/I][/B] is generated with

    def BodyNodes(self):
        for i in dir(FBBodyNodeId):
            if i[0] == 'k':
                try:
                    self.BodyNodeObject[BodyNodesId[i]] = getattr(FBBodyNodeId, i)
                except:
                    pass

[B][I]BodyNodesId[/I][/B] is simply a dictionary

    BodyNodesId = OrderedDict({
            'kFBChestNodeId':'Spine1',
            'kFBHeadNodeId':'Head',
            'kFBHipsNodeId':'Hips',
            'kFBLeftAnkleNodeId':'LeftFoot',
            'kFBLeftCollarNodeId':'LeftShoulder',
            'kFBLeftElbowNodeId':'LeftForeArm',
            ...
    })

Things in FBX SDK aren’t as easy as in the Pyfbxsdk that the motionBuilder and Maya use