How to create an AnimationClip completely from scripts?

Hello there,

I’m analyzing the viability of recreating in Unity3d an old game of the company I’m working.

The game was built under an in-house game engine using DirectX 9 which all the graphic assets (3d models, textures, animations, etc) were created using closed binary file structures.

I have already figured out what to do with the textures and 3d models and how to import them into Unity3d. The problem I’m facing is regarding animations.

The animations of this game are simple. Each animation have its own file which contains the offset to be applied to the position and rotation of each bone of a given 3d model, in each animation frame. They are represented by D3DXMatrix objects.

I want to know how to use that information (offsets of position and rotation on each bone) to recreate them in Unity3d as AnimationClips via scripting or an other feasible method.

I might be wrong but I believe you can’t either create or edit animation clips outside of the editor

the only thing you might be able to change through script are some parameters like speed and whatnot

I’ve never done this myself but I have heard something of the sort. With each bone being a component of the parent, as long as weight and skin modifier has been applied I think you just move/rotate the bone object. I’m not certain that’s the exact method but I’ve seen it done. I’ll try and find where I read that and get back to you.