Boned Animation Conundrum

Blitz3D Forums/Blitz3D Programming/Boned Animation Conundrum

Makepool(Posted 2005) [#1]
I have a character where I want to play an animation of him shooting, however this character can be either standing or walking when he starts shooting which means I can’t have four animations, two standing and walking without firing, the other two standing and walking while shooting. The reason being that if the character is already walking and I want him to start shooting if I switch between the normal walking animation and the walking and shooting animation then his legs will almost certainly snap to another position and his walk will be all messed up.

I wondered if the solution was to have animations where only the part of the body affected had any bones in it, for example I did a test where the character is walking, then I begin to play the animation where he raises his arm to fire, now instead of the legs suddenly snapping to a different position they remain exactly where they were when the other animation cycle started. Basically what I’m asking is there anyway to get one model animated by two animations at the same time that don’t affect each others bones, for example the walking animation just affects the bones in the legs, at the same time another animation is played where the arms raise the gun to fire but this only uses the bones in the arms so that the two sets of animations do not interfere with each other.


scribbla(Posted 2005) [#2]
you could split the model in to top and bottom and parent one to the other, that way you could have seperate anims playing for both parts


Makepool(Posted 2005) [#3]
Yeah that's the way I'm doing it at the moment but I could achieve much better results and more complicated effects if there was another way.


Duckstab[o](Posted 2005) [#4]
if you can get the info of a a bones roll,yaw,pitch
like shoot anim is frame 1 to 20
handbone
elbow
shoulder
store all these into into an array or type

then durning game you animate the model walking
after updateworld you could rotate the bones involed in the
shoot anim with the data stored in the array/type

this should combine to two

as you can parent any object to a bone this should be possible

good luck


scribbla(Posted 2005) [#5]
@Duckstab
nice idea..you could get the exact pitch,bank,roll from the
modeler you were using ,just do the anim you want in your modeler and note down the offsets of each bone,
use getchild() to get the bones in the arm parent the chain, hand,wrist,arm,shoulder then get current co-ords and add the offsets...well in theory anyway


Barliesque(Posted 2005) [#6]
...or you could simply put the animations into a B3D file, but load a version of your B3D with just the bones and no animation. Then manually load up bone key data, using sample code from here:
http://www.blitzbasic.com/sdkspecs/sdkspecs/b3dfile_utils.zip

It should then be possible for you to add animations together. If you apply the bone rotations and offsets from one key, you would then further rotate and offset bones using another key.

The idea of additive animation can be tricky, in terms of creating the animations, but with a little testing, I think this could work.


jhocking(Posted 2005) [#7]
A similar idea is to have a bones-only version of my model animating at the same time as the visible model. Then every frame after UpdateWorld I set some of the bones in the visible model to the same orientation as those bones in the invisible model.

If this works, the advantage here is that you get Blitz to play the animations (as opposed to you doing animation playback from keyframe data,) with interpolation and blending and whatnot.


Rob Farley(Posted 2005) [#8]
Personally I stick to seperate animations, a person doesn't walk and shoot in the same way as they would just walk. For example; If you were holding a gun at your hip you'd be twisted and side stepping slightly.


scribbla(Posted 2005) [#9]
too many options and not enuff coding skill for any:(

but i like Barliesques idea
but couldnt you have the model with a basic set of anims then load extra data in for extras like firing or taking weapons out
as far as im following this, this would mean another .b3d file with the necessary bone anims in and grab the extra data


Strider Centaur(Posted 2005) [#10]
Dont most animation tools come with the stock standard gun toating animations, so all you would need to do is bind the vertex's to the bones you want and then save?

Im fairly sure CharacterFX does and I know others do this.