3D Animation Oddity

Blitz3D Forums/Blitz3D Programming/3D Animation Oddity

Makepool(Posted 2005) [#1]
I load animations in the following way:

Player(0) = LoadAnimMesh( "breathe.b3d" ) ;anim seq 0
Player(0) = GetChild(Player(0),1);
LoadAnimSeq(Player(0),"Marinewlk.b3d") ;anim seq 1
LoadAnimSeq(Player(0),"Walk.b3d") ;anim seq 2

I start off by playing the ‘base’ animation (anim seq 0 in the example), this works fine. I then play any of the other animations, this works fine. The next animation played will be contorted somehow; the bones will not be in the positions where they should be.

I have noticed that once the animation becomes contorted, playing the ‘base’ animation again means that the next animation will play correctly again and whatever animation is played after that will work correctly but the next animation played after that will then breakdown once more.

Has anybody else encountered this problem? Does anybody know what to do? I assume it’s a problem with how the animations are exported. I’m using MAX5 and B3D Pipeline.


jfk EO-11110(Posted 2005) [#2]
It sounds to me like you didn't set keyframes for all bones on the very first frame of each sequencs, something you should do in max.


Makepool(Posted 2005) [#3]
Actually I'm not doing the models myself but my friend claims he has keyframes at the start and end of all the sequences. Anyway, surely if they didn't have keyframes then they wouldn't animate properly even the first time they were played.


jfk EO-11110(Posted 2005) [#4]
Well if you have keyframes at the beginning of the first sequence, the would play ok if you play the sequences one by one, only when play eg. the 3th first and then the 2nd, it wouldn't work. But playing 1,2,3 would work since each sequence ends where the next one starts.

You could test it, I guess you can play a sequence with a speed of 0.001 or so, then check it's pose. If it's the correct start pose for this sequence (all bones), then the keys are there.


jfk EO-11110(Posted 2005) [#5]
Uh, wait a minute -
Player(0) = LoadAnimMesh( "breathe.b3d" ) ;anim seq 0
Player(0) = GetChild(Player(0),1);
LoadAnimSeq(Player(0),"Marinewlk.b3d") ;anim seq 1
LoadAnimSeq(Player(0),"Walk.b3d") ;anim seq 2

What the heck are you doing here? Parenting the basic handle to the added sequences? Why? Why don't you simply:
Player(0) = LoadAnimMesh( "breathe.b3d" ) ;anim seq 0
LoadAnimSeq(Player(0),"Marinewlk.b3d") ;anim seq 1
LoadAnimSeq(Player(0),"Walk.b3d") ;anim seq 2


That's the way the command works by default.


Makepool(Posted 2005) [#6]
I don't do that because we never got animations to work that way. We export the entire model and its bones for the first animation which we then use GetChild on. Subsequent animations just have their bones exported.

Well if you have keyframes at the beginning of the first sequence, the would play ok if you play the sequences one by one, only when play eg. the 3th first and then the 2nd, it wouldn't work. But playing 1,2,3 would work since each sequence ends where the next one starts.

That's the thing, we can play ANY animation after we've played the first animation so 1,2 or 1,3 or 1,4 etc but the next animation after that doesn't play correctly.


Ross C(Posted 2005) [#7]
By doing that, you lose the handle the the rest of the model, because Player(0) now only holds the child mesh.


Makepool(Posted 2005) [#8]
So can anybody tell me how to export all my animations in MAX the same way and avoid having to use GetChild?


jfk EO-11110(Posted 2005) [#9]
Export it without Geometry, but keep the main handle intact. you may hide the mesh, so it will export the bones only, including the entire hierarchy. Well, I didn't test this.


Makepool(Posted 2005) [#10]
Okay peeps, I think I've more or less sorted it on my own. I'm not using GetChild at any point anymore and I'm exporting all my animations the same way, that is I hide the bones and uncheck the 'scene root' button in Pipeline. Everything works okay with the animations now but I've noticed that if you run the game in debug mode, when you quit it pops up with two "entity does not exist" messages followed by loads of other error messages.

Any ideas?


Makepool(Posted 2005) [#11]
Please


Hujiklo(Posted 2005) [#12]
Use get child - export with the scene root - as far as I know it's important. Change the child's variable name to Playerchild or something (obviously makes sure it's a global if you intend to keep track of it)....instead of loading the animations in the example you gave..assign a global variable to each sequence (providing you export all the animations in one file which is the easiest way to do it) this way you can keep track of each sequence much easier....it's always worth exporting the bones in my opinion - they are so hand for attaching weapons to etc - just don't export them in the pipeline as meshes.

Let me know if this didn't make much sense.

(I'm sure your missing entities are because you're not using globals somewhere.)


Raitsun(Posted 2005) [#13]
Makepool... the problem could be your hardware... some hardware dealer probably fooled you ;-].


Makepool(Posted 2005) [#14]
I don't think the missing entity message is anything to do with the code as bar the omission of GetChild the code is identical to what it was when using the other models. The model handles are actually in an array 'Player(0) = LoadAnimMesh( "breathe.b3d" ) ;anim seq 0' so they already are global.

It's definitely not a hardware fault because I've tried it on more than one system and it always crashes when quitting from debug mode on every machine.


Hujiklo(Posted 2005) [#15]
Sorry - I missed that array you had there...well then do you use 'clearworld' anywhere?...any entity code that might be running immediately after that command somewhere will give you that message.