Help: Playing 2 Animations at a time

Blitz3D Forums/Blitz3D Programming/Help: Playing 2 Animations at a time

Luke.H(Posted 2004) [#1]
Is it possible to play 2 animations at the same time on a mesh?
For example: Having a player run and shoot at the same time.
I was thinking that you could move that mesh by adding the 2 animations rotation together of each child.
Does anyone have any code, or links?


jfk EO-11110(Posted 2004) [#2]
Two ways: handle upper and lower body parts seperately, so save the legs with the running animation and the chest, arms and head with the shooting animation (and more). you will then parent both to a character Pivot and play the wanted animation sequences. Pro: high moularity, con: unfriedly feel to design animations this way.

Possibility 2: Use "handmade" Animations for the second animation. That means you need a tool that will store all bone rotations and translations in your special File Format, and then manualy assign them to the bones right after the UpdateWorld() and before the RenderWorld() Command. Pros: ultimate Flexibility, cons: complicated workflow.


Luke.H(Posted 2004) [#3]
Possibility 2 maybe alright but making a special File Format and making a program that makes it and than reading it in the program is a lot of work.
Do you have any code, links, examples?

I was thinking you could play the walking animation with the animate command and then manually assign the hand after UpdateWorld() for the shooting animation but I do not want to program it in manually I want to use a animating program.


Ricky Smith(Posted 2004) [#4]
Another way to blend animation would be to use a hidden proxy. While the visible model is doing a walk animation the hidden proxy can be running a shoot animation. You just then copy the bone rotations of the upper body(or the joints required) from the proxy to the visible model between UpdateWorld and RenderWorld.


Luke.H(Posted 2004) [#5]
Good idea


Luke.H(Posted 2004) [#6]
I wouldn't want to have use a hidden mesh for all the players and AIs. Could I use SetAnimTime on one mesh and rotate any others based on it, but using transitions. It only reason for doing this would be to save memory and speed.


Ricky Smith(Posted 2004) [#7]
The problem with setanimtime() is that it will move directly to that position with no transition or tweening. You can only tween between sequences not individual frames. A workaround may be to extract each frame as an individual sequence (of one frame length) you could then use the Animate command with a sequence id to tween to an "individual" frame ( a sequence of one frame length).
This would not really be suitable for the purpose of blending 2 animation sequences.
To save memory and speed you could try copyentity to make various instances of the proxy and your proxy can be the skeleton with animation keys only without any mesh or texture. It could even be a skeleton of the upper body only in this case or even just an arm. As long as the joints in the proxy you want to blend have the same initial rotation values as the visible model.
I will create an export option in PaceMaker that exports just the skeleton or selected joints and their animation keys

The other alternative is to write your own animation/tweening engine which will then give you total control. Have a look at the Quaternion functions in the archives especially the Quatslerp function which makes tweening between animation frames easy.


scribbla(Posted 2004) [#8]
ummm same problem i have, something im just about to try is the split model approach. on the face of it it seems simple to animate upper and lower body seperate then parent them in blitz as jfk said.
i cant see a problem with working with it in a 3d package, load both parts into 3d package then do the anims then delete one half of the model before conversion,
im using lightwave so i will end up with 2 scene files..guess i will find out if it works ;)


Luke.H(Posted 2004) [#9]
Thanks,
I have got the animations to work. I have make the player be able to shoot, run, and look at the target at the same time. I had to use a 2nd mesh like Smiff said for every player, which I don’t like. When PaceMaker can export just the skeleton I will be much happier.