Jump to content
  • entries
    12
  • comments
    55
  • views
    21,232

Animation Prototype


klepto2

2,566 views

 Share

Well, long time has passed since i have written a new entry.

 

While I'm still working on the asset manager and Texture Converter (non threading version) I have prototyped a small animation class

in Blitzmax which can handle multiple animations at once for a single mesh. eg: you can walk and use your sword in the same time.

 

Everything is handled automatically you just give a root animation a speed factor and a blend factor. Later you can simply add an 'extra'-

animation to the mesh by using the bonename and an animation name. As you will notice in the video i have not yet synced some values eg:

when does an once time played animation blend out. But i think the video gives an idea what is possible with Leadwerks Engine.

 

Here is a small codesnippet from my sample project how animation is handled:

If JUMP = 0 Then
		If move = 0 Then
			scene_helper.playeranimator.SetMainAnimation("Idle")
			scene_helper.playeranimator.SetAnimSpeed(3) ;
		Else

			If Abs(move) >= 1.5 Then
				scene_helper.playeranimator.SetMainAnimation("run")
				scene_helper.playeranimator.SetAnimSpeed(Sgn(move) * 2.0) ;
			Else
				scene_helper.playeranimator.SetAnimSpeed(Sgn(move) * 3) ;
				scene_helper.playeranimator.SetMainAnimation("walk w/o sword")
			End If
		End If
	Else
		scene_helper.playeranimator.SetMainAnimation("jump", ANIMSTYLE_ONCE)
		scene_helper.playeranimator.SetAnimSpeed(Sgn(move) * 3) ;
	End If

	If MouseHit(MOUSE_LEFT)
		scene_helper.playeranimator.SetExtraAnimation("Bip01_R_UpperArm", "attack combo", ANIMSTYLE_ONCE)
	End If

	If MouseHit(MOUSE_RIGHT)
		scene_helper.playeranimator.SetExtraAnimation("Bip01_L_UpperArm", "pick up", ANIMSTYLE_ONCE)
	End If

 Share

6 Comments


Recommended Comments

ah nice... thanks.

 

i would love to see a comparison of fps of your animation code versus if it was in a lua script for the entity... would be interesting to see.

Link to comment

I had something similar to this, but the crappy part was the animations weren't really setup correctly for it. As I'm sure you noticed with that model, which I have also, the attack animation isn't setup that create to be played with the lower half having the walking animation playing at the same time. Just looks unnatural.

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...