Area :: Header
Meet the Experts Webinar
Learn how Black Forest Games rebooted the classic C64 platform game “Giana Sisters” from 1987 using Autodesk 3ds Max®.
Discussion Groups

Python

Reply
Valued Contributor
spark
Posts: 52
Registered: ‎01-09-2007

import custom-format data into scene

3 Views, 0 Replies
02-03-2011 06:15 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 = lcl RotateX value at frame 0
Data.LeftArm.RotateY = lcl RotateX value at frame 1
...
Data.RightAnkle.Translate = 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?

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