Animations problem!

Blitz3D Forums/Blitz3D Beginners Area/Animations problem!

Kippykip(Posted 2013) [#1]
I'm trying to make the stickman model play between frames 5-10 but when I add the cast, it doesn't animate!

--DOESN'T WORK--
sm1=LoadAnimMesh("sm1.b3d")
Animate sm1,1,tempo#,5,10

--WORKS BUT PLAYS THE ANIMATIONS I DON'T WANT--
sm1=LoadAnimMesh("sm1.b3d")
Animate sm1,1,tempo#

can somebody help me? thanks :)


Yasha(Posted 2013) [#2]
That's not what those parameters do. "Animate" uses animation sequences, not frame numbers: you've told it to play sequence number 5, with a transition of 10.

To use frame numbers with B3D models, you need to animate the mesh manually using SetAnimTime (there's probably a wrapper for this in the Archives that makes it into a simple command like Animate).

To use B3D meshes as-designed, you could edit the mesh in your favourite animation tool, and either find out what sequences are present, or add some to the file over the frame ranges you want. There's also the ExtractAnimSeq command, that can be used to define new anim-sequences on an entity using frame ranges, which can then be used with the standard Animate command (this is ....probably the easiest option by far).

Last edited 2013


Kippykip(Posted 2013) [#3]
Thanks!!


Kryzon(Posted 2013) [#4]
I was ripping the models from some games for personal study.
The models from Kingdom Hearts (PS2) had all animation in a single file (including sequences for cinematics\cutscenes), with one file for each character.
This is more optimized since you won't have all the redundant file data you'd get if you stored all your sequences over several different files, each one with its own headers and padding.

To do this you would animate your character in your favourite package, then merge all his sequences into the same scene so he has one big animation timeline expressing all his sequences progressively.
Say, walking 0-15, running 16-27, jumping 28-35, falling 36-41, dying 42-60, cutscene1 61-253, cutscene2 254-418.
Then you load this single B3D file and extract each sequence with ExtractAnimSeq so you can individually play each sequence appropriately.

Even if you don't want to do the above, using sequences is very beneficial as it allows you to put to use the Transition# parameter of Animate (it only works with sequences), which blends sequences at their overlap so nobody will notice when one sequence ends and the other starts - in other words, with a transition of 10 or more you'll get a smooth blending between the previous and current sequences being played, looking much more natural (you can see this in action in the Blitz3D sample Mak\Anim\Anim.BB).

Last edited 2013


RemiD(Posted 2013) [#5]
kippykip>>
See this code it may help you to understand a way to use these commands :
http://blitzbasic.com/Community/posts.php?topic=99680#1171470


Kippykip(Posted 2013) [#6]
well the post is basically solved thanks to Yasha but thanks anyway! :D