Animation blending in DX9

Started by
18 comments, last by Night Elf 21 years, 2 months ago
quote:
Even before you get to animation blending...how do you export a 3DS model with more than one animation or timeline?

You don''t. AFAIK, you have two options:
1. Export to different .X files and manually merge them into a single file by copying and pasting. (This has been explained in other threads. See: http://www.gamedev.net/community/forums/topic.asp?topic_id=126399). Then you just load the resulting file.
2. Export to different .X files and load the animations from these files into a single animation controller. This is the way multiple animations are loaded in the Mesh Viewer tool that comes with the DX9 SDK.
Advertisement
Thx, I''ve got multiple animations in one file now.

I''ve also got the different animations bound to different keys, and they switch nicely.

I can''t seem to figure out how to blend between animations tho. The last and final piece to the puzzle...

I imagine the process goes something like this:

1) load/register animation sets
2) key track params
3) enable tracks/mixer

But who knows...

Is there a Microsoft email we can all flood with requests for a sample app demonstrating animation blending?
I couldnt get it to work either.... grrrr... Im running out of hair to pull out!

One of you be kind enough to lead us lesser mortals in the right direction when you figure it out plz.
Wikkyd~"Do what thou wilt shall be the whole of the Law!"~Aleister Crowley, The Beast 666
hi,

has this been solved?
http://www.dualforcesolutions.comProfessional website designs and development, customized business systems, etc.,
This is what I did. I imagine that the times would need to be different depending on the speed of your animation.

This code blends from one animation to another. The current animation is at track 0, and the new animation index is AnimIndex in the code.

The Track Description has the time of the track, and when you set a new animation set, it is undefined. So it''s quite important to set it.

(Apologies for posting inline, not sure how to do the cute code windows yet)


// Move Track 0 to track 1
D3DXTRACK_DESC Desc;
LPD3DXANIMATIONSET AnimSet;
m_AnimController->GetTrackDesc(0, &Desc);
m_AnimController->SetTrackDesc(1, &Desc);
m_AnimController->GetTrackAnimationSet(0, &AnimSet);
m_AnimController->SetTrackAnimationSet(1, AnimSet);

// Load the new animation set into track 0
m_AnimController->GetAnimationSet(AnimIndex, &AnimSet);
m_AnimController->SetTrackAnimationSet(0, AnimSet);

// Set the track description
// Set the weight to 0 for the blend
Desc.Weight = 0;
Desc.AnimTime = AnimSet->GetPeriod();
m_AnimController->SetTrackDesc(0, &Desc);

// Key the blend
m_AnimController->KeyTrackWeight(1, 0, m_AnimController->GetTime(), 0.002, D3DXTRANSITION_EASEINEASEOUT );
m_AnimController->KeyTrackWeight(0, 1, m_AnimController->GetTime(), 0.002, D3DXTRANSITION_EASEINEASEOUT );
I can''t believe that MagTDK couldn''t get this to work... I got all of my animation help from his post.
Sleep is for the weak and needy, Mountain Dew and Pizza are for the real men.

quote:
I can''t believe that MagTDK couldn''t get this to work... I got all of my animation help from his post.


Smoot, if your referring to animation blending, I posted how I did it a while back ago here:

http://www.gamedev.net/community/forums/topic.asp?topic_id=130637

sorry, MagTDK. No offense was implied. Just that your post helped everything that I did tremendously.

Again, No offense was implied.
Sleep is for the weak and needy, Mountain Dew and Pizza are for the real men.
double post...

[edited by - Smoot on January 15, 2003 10:33:06 PM]
Sleep is for the weak and needy, Mountain Dew and Pizza are for the real men.

Glad I could help

This topic is closed to new replies.

Advertisement