python - FBX SDK - Get the FbxNode from an ENodeId of a Character -
is possible associated fbxnode
enum enodeid ? example if want fbxnode character::elefthand
i tried use character::getcharacterlink(enodeid, fbxcharacterlink)
extracting fbxnode fbxcharacterlink
calling fbxcharacterlink::mnode
however function returns enodeids false, no fbxcharacterlink
created.
character = myscene.getcharacter(0) lefthand = character.elefthand lefthand_node = fbxcharacterlink() character.getcharacterlink(lefthand, lefthand_node) # false lefthand_node = lefthand_node.mnode
when scripting inside motionbuilder using python , pyfbxsdk
, easy, no matter how skeleton objects named, can fbxobject
of it
m = character.getmodel(self.bodynodeobject[o])
and bodynodeobject
generated with
def bodynodes(self): in dir(fbbodynodeid): if i[0] == 'k': try: self.bodynodeobject[bodynodesid[i]] = getattr(fbbodynodeid, i) except: pass
bodynodesid
dictionary
bodynodesid = ordereddict({ 'kfbchestnodeid':'spine1', 'kfbheadnodeid':'head', 'kfbhipsnodeid':'hips', 'kfbleftanklenodeid':'leftfoot', 'kfbleftcollarnodeid':'leftshoulder', 'kfbleftelbownodeid':'leftforearm', ... })
this worked me
from fbx import * in range(myscene.getcharactercount()): character = myscene.getcharacter(i) node = character.ehips link = fbxcharacterlink() while (character.getcharacterlink(node, link)): print node, link.mnode.getname() node = character.enodeid(int(node+1))
Comments
Post a Comment