AREA forums upgrade
Read more about the planned upgrade of our forums
  • 1/3
You are here: Forum Home / Autodesk® MotionBuilder® / Python / import custom-format data into scene
IMPORTANT ANNOUNCEMENT ABOUT AREA FORUMS
  RSS 2.0 ATOM  

import custom-format data into scene
Rate this thread
 
51996
 
Permlink of this thread  
avatar
  • steebu
  • Posted: 03 February 2011 01:15 PM
  • Total Posts: 51
  • Joined: 09 January 2007 01:40 PM

I have a scene with a skinned mesh.  No actor, no animation data on the mesh.

I want to load a custom data file and have the character move about.

The format is similar to BVH - one part to describe the hierarchy, one part of data.

What’s the most efficient way?  I imagine I may end up having to use the SDK for speed’s sake, but I wanted to give python a shot, first.

Assume that the data from the file is loaded in memory and is accessed in a sensible way, e.g.

Data.LeftArm.RotateX[0] = lcl RotateX value at frame 0
Data.LeftArm.RotateY[1] = lcl RotateX value at frame 1
...
Data.RightAnkle.Translate[0] = lcl Translate value at frame 0
...

So I’m thinking I’d have to loop thru each frame, then for each bone, find its Translate/Rotate/Scale’s AnimationNode’s XYZ AnimationNode’s FCurve, do a KeyAdd and set the value from Data.LeftArm.RotateX[n]?

Sounds rather easy, but a bit cumbersome and slow.  I guess I can’t set the FCurve to some array of data?



Replies: 0