CMPUT414W15 / LEAP

MIT License
2 stars 1 forks source link

Convert BVH animation data into FCurve #9

Closed aktse closed 9 years ago

aktse commented 9 years ago

Wasn't necessary to write scripts to convert data. Turns out animation data are stored as FCurves but in a lower layer:

Eg.

hips = FBFindModelByLabelName("BVH:Hips")
nodeA = hips.AnimationNode #High level animation node

for nodeB in nodeA.Nodes: # Translation/Rotation/Scaling nodes
    for nodeC in nodeB.Nodes #X/Y/Z nodes
        fcurve = nodeC.FCurve #FCurve exists for XYZ nodes
        for key in fcurve.Keys: #Get FCurve key data 
            print key.Value
            print key.Time

Can also acquire other FCurve key data such as interpolation method (linear/cubic etc)