Count Mesh Animations?

Blitz3D Forums/Blitz3D Programming/Count Mesh Animations?

Guy Fawkes(Posted 2016) [#1]
Hi all. Is there a way ( or a hacky way even ) for that fact to count how many total animation frames a mesh has? and then return it in a function? ( I'm using this for a totally new animation system that I'm writing )

Thanks all! =)

~GF


RemiD(Posted 2016) [#2]
You can count how many frames there are in an animation sequence with AnimLength() and you can also get the current animation frame number with AnimTime()


Guy Fawkes(Posted 2016) [#3]
Thanks, but what I'm looking for is either a way, or a hacky way to return the TOTAL amount of frames in a mesh.

~GF


RemiD(Posted 2016) [#4]
In this case you probably need to read the .b3d file...


Guy Fawkes(Posted 2016) [#5]
Is there any demo of counting the total amount of frames in a 3D mesh? ( B3D, X, 3DS) ?

~GF


wmaass(Posted 2016) [#6]
Without looking too closely I think the mak/anim sample does that. So load the file and use AnimLength perhaps?


Guy Fawkes(Posted 2016) [#7]
OMFG! THANK you!

I have been trying for a day & a half now to figure this one out!

~GF


Zethrax(Posted 2016) [#8]
So basically...

G_beast = LoadAnimMesh( "media\Beast\beast.b3d" )
; Animations will be set to anim sequence zero at this point. This anim sequence will contain all the animation frames in the model.
num_total_anim_frames = AnimLength ( G_beast )

Useful if you're making an editor or something similar I imagine.

--

You could also presumably change the animation sequence using 'Animate' and get the count of a specific sequence. Somewhat redundant though, as you need to know the start and end frame indexes to set the animation sequence to begin with and could calculate the length.


Guy Fawkes(Posted 2016) [#9]
Basically. Thanks guys! =D This helps ALOT! =D

~GF