How to check if model is static or animated

Blitz3D Forums/Blitz3D Programming/How to check if model is static or animated

xmlspy(Posted 2006) [#1]
How can I check if the model I'm loading is animated or just static?


jfk EO-11110(Posted 2006) [#2]
You may try to use AnimLength(mesh). When used with a static mesh (not loaded with LoadAnimMesh, but eg. CreateCube) it will return -1.There is a problem with 3ds meshes saved in 3dsmax. Eg. a simple cube that was saved as a static mesh, will claim to have 100 animation frames when used with LoadAnimMesh and AnimLength. THe reason why is, the timeline of 3ds max is 100 frames by default, and they are saved, even when you don't animate the object and there are no keyframes. And you can even "Animate" it, although there is no animation data inside other than a number of empty frames.

However, when used with a a mesh that doesn't contain any animation, like eg. a b3d file saved by maplet, the AnimLength will be -1 as well.

I don't know if there's a way in todays 3ds max to avoind saving animation frames in 3ds, other then setting the lenght of the animation to zero.


Ross C(Posted 2006) [#3]
Why not, in the modeller, give the mesh a filename, with a info tagged in. like:

"mesh_anim.b3d"

Then, when loading in a mesh, parse the filename and check for "anim"


xmlspy(Posted 2006) [#4]
Ross C, that is actually not a bad idea! :)