Blender Animation

Blitz3D Forums/Blitz3D Beginners Area/Blender Animation

Happy Llama(Posted 2012) [#1]
Is it possible to use one of the Blender file formats for animation in Blitz3D? And if so, what commands would you need to use?

Last edited 2012


Yasha(Posted 2012) [#2]
Blitz3D only supports animation loaded from B3D, 3DS, X (DirectX 7 version) and MD2 files. For anything else, you'll need a hand-written importer. I know importers exist for MD3 and BVH, and there might be a few others in the archives, but I don't think there is one for Blender's native format.

Options:

-- find the B3D export plugin for Blender, get it working, and use that to export files with native support
-- Use 3DS, which Blender can export natively (not recommended, 3DS files suck)
-- Find an MD2 or MD3 exporter for Blender: adequate if you don't need ragdolls and don't mind comparatively large files
-- Use 3DS to animate the bone pivots and to store the skin mesh, export separately, attach the vertices to the bones from within B3D, saving bone weights as vertex colours or similar. Stupid and roundabout, not recommended
...


Happy Llama(Posted 2012) [#3]
what commands would I have to use to load and play an animated model?


Yasha(Posted 2012) [#4]
At a bare minimum you need LoadAnimMesh, Animate, and UpdateWorld.

For finer manual control, you might also want to use SetAnimTime.

AnimSeq, AnimLength, AnimTime and Animating are query functions which return information about the animation status of a given entity.

The other functions in the "Entity Animation" section (the ones ending in "Seq") are more advanced, and you don't need to worry about them right now - or ever, unless you plan to add animation from multiple sources to your models (an important optimisation for a commercial game with a lot of similar characters, but not necessary early on).


Happy Llama(Posted 2012) [#5]
How about if I wanted for example to loop frames 0-24 when your walking and frames 25-60 while your standing still. What command would let you do that?


Yasha(Posted 2012) [#6]
ExtractAnimSeq would be the one to look at. Create a sequence with that (note: it creates a sequence, so only ever call it once for a given entity, and store the returned index somewhere), and pass it to Animate in the "sequence" position.

Note that Animate only needs to be called to start an animation: updating the animation once it's been triggered is the responsibility of UpdateWorld (a rookie mistake is to put Animate in the main loop, which just causes the animation to restart every frame and not appear to move).