Author Topic: What is the essence of animation blending in D3?  (Read 1932 times)

0 Members and 1 Guest are viewing this topic.

bitterman

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: +9/-5
  • Doom Newbie
    • View Profile
What is the essence of animation blending in D3?
« on: December 13, 2017, 10:53:19 AM »
E.g. I typed 'testmodel char_betruger'.

Model has got few anims, e.g. walk and idle.

When I try to blend these anims with 'testBlend walk idle 15' it's not working (I don't see any blending).

How can I get some example with animation blending with this or other model?

In what cases need I use it? Any examples?

Thanks.




bitterman

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: +9/-5
  • Doom Newbie
    • View Profile
Re: What is the essence of animation blending in D3?
« Reply #1 on: December 14, 2017, 06:11:37 AM »
Looks like this command must play both anims in one time (line 615, 616). But it don't. Hmmm...

Quote
=====================
  590 idTestModel::BlendAnim
  591 =====================
  592 */
  593 void idTestModel::BlendAnim( const idCmdArgs &args ) {
  594         int anim1;
  595         int anim2;
  596
  597         if ( args.Argc() < 4 ) {
  598                 gameLocal.Printf( "usage: testblend <anim1> <anim2> <frames>\n" );
  599                 return;
  600         }
  601
  602         anim1 = gameLocal.testmodel->animator.GetAnim( args.Argv( 1 ) );
  603         if ( !anim1 ) {
  604                 gameLocal.Printf( "Animation '%s' not found.\n", args.Argv( 1 ) );
  605                 return;
  606         }
  607
  608         anim2 = gameLocal.testmodel->animator.GetAnim( args.Argv( 2 ) );
  609         if ( !anim2 ) {
  610                 gameLocal.Printf( "Animation '%s' not found.\n", args.Argv( 2 ) );
  611                 return;
  612         }
  613
  614         animname = args.Argv( 2 );
  615         animator.CycleAnim( ANIMCHANNEL_ALL, anim1, gameLocal.time, 0 );
  616         animator.CycleAnim( ANIMCHANNEL_ALL, anim2, gameLocal.time, FRAME2MS( atoi( args.Argv( 3 ) ) ) );
  617
  618         anim = anim2;
  619         headAnim = 0;
  620 }
  621
  622 /***********************************************************************

bitterman

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: +9/-5
  • Doom Newbie
    • View Profile
Re: What is the essence of animation blending in D3?
« Reply #2 on: December 15, 2017, 10:51:06 AM »
It works like this:


The Happy Friar

  • Happy Happy Joy Joy
  • Administrator
  • Hero Member
  • *****
  • Posts: 1,031
  • Karma: +46/-4
  • Semi-Newbie.
    • View Profile
    • EarthQuake
Re: What is the essence of animation blending in D3?
« Reply #3 on: December 15, 2017, 09:04:10 PM »
cool.  never messed with the testblend command.  So does it work now?

bitterman

  • Sr. Member
  • ****
  • Posts: 382
  • Karma: +9/-5
  • Doom Newbie
    • View Profile
Re: What is the essence of animation blending in D3?
« Reply #4 on: December 15, 2017, 11:42:51 PM »
Yes, just try these console commans after ' testModel'.

As I undetstand it the anim blend used in D3 to create a smooth transition between anims with different starting poses.
« Last Edit: December 16, 2017, 11:04:56 PM by bitterman »