Skip to main content
gamedev.net
🔒 Locked

AnimationController functions confusion

Started by DXnut 2 replies 2k views
Original Post
DXnut
DXnut
Hi, I don't understand the difference between two AnimationController functions: RegisterAnimationOutput: Register SRT keys directly. I don't understand this one. RegisterAnimationSet: Register a set that has been built with keys. I understand this one. And then there are two corresponding functions to get the max outputs and max sets. I can't figure out what an "output" is, nor why you would register one. A track seems to be synonomous with a set. The controller managaes sets/tracks. So, what is an output and how does it differ from a set? When I load the tiny_4anim.x file included with the MultiAnimation sample in the SDK, I see that the max tracks is 2, max events is 30, and max outputs is 48. Thank you very much if you can answer this one!
--------------------------Most of what I know came from Frank D. Luna's DirectX books
jamesw
jamesw
I can't answer a lot of your questions, but I can tell you the difference between a track and an anim set. A track is like a secondary buffer in DirectSound, you set an animation set playing on it and it is blended with whatever other tracks are active by the AnimationController. Only two tracks are supported, because the only reason tracks are needed is to blend from one animation set to the next, for example standing still to walking. Animation sets are a list of transformations and the bones they apply to, so 'walk' and 'run' would be anim sets. In summary, tracks are managed by the AnimController, and anim sets are created by the artist, and then assigned to a track in order to be played.
DXnut
DXnut
THanks for the reply, but I figured that already.

My best guess is that the controller is also made to support rigid animations, and you can use the RegisterOutput to create one set and add keys to it. The RegisterSet is used to create a new set and register all the keys in that set.

There are 46 animation frames in the Tiny_4anum.x mesh. The max outputs is 48. Maybe these numbers are related?

Thanks.
--------------------------Most of what I know came from Frank D. Luna's DirectX books
hplus0603
hplus0603
This is necroing a thread, but I figured I'd add the right answer, because this thread came up when googling for this function.

RegisterAnimationOutput() tells the animation controller where it should write the bone/joint transforms as you call AdvanceTime() on the animation. I e, it tells the animation controller where you expect the actual output of the animation to go.

You need to call RegisterAnimationOutput() once per bone that you want to read the output of. However, if you just use the D3DXFRAME structures returned by D3DXLoadMeshHierarchyFromX(), then those are automatically pre-registered by the loading function, and you don't need to call this function.

As a corollary, if you delete the D3DXFRAME structures you allocated in your AllocateHierarchy interface, but do not re-register all the outputs (for all the bones), then the animation controller will write into random memory (where the structs used to live), which is a Bad Thing.
enum Bool { True, False, FileNotFound };

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.