是否可以从枚举ENodeId中获取关联的FbxNode
?
例如,如果我想从Character::eLeftHand
我尝试使用Character::GetCharacterLink(ENodeId, FbxCharacterLink)
然后只需调用FbxCharacterLink
FbxCharacterLink::mNode
中提取FbxNode
但是,此函数会返回大多数ENodeIds False,因此不会创建FbxCharacterLink
。
character = myScene.GetCharacter(0)
lefthand = character.eLeftHand
lefthand_node = FbxCharacterLink()
character.GetCharacterLink(lefthand, lefthand_node) # False
lefthand_node = lefthand_node.mNode
当我使用Python和Pyfbxsdk
在Motionbuilder中编写脚本时,它非常简单,无论骨架对象如何命名,我都可以获得它的FBXObject
m = character.GetModel(self.BodyNodeObject[o])
使用生成和BodyNodeObject
def BodyNodes(self):
for i in dir(FBBodyNodeId):
if i[0] == 'k':
try:
self.BodyNodeObject[BodyNodesId[i]] = getattr(FBBodyNodeId, i)
except:
pass
BodyNodesId
只是一本字典
BodyNodesId = OrderedDict({
'kFBChestNodeId':'Spine1',
'kFBHeadNodeId':'Head',
'kFBHipsNodeId':'Hips',
'kFBLeftAnkleNodeId':'LeftFoot',
'kFBLeftCollarNodeId':'LeftShoulder',
'kFBLeftElbowNodeId':'LeftForeArm',
...
})