MD2 export animation issues

Hi, everyone. I’m having issues getting animation to export from blender to MD2 format using the MD2 exporter that is bundled with 2.49. I’m just trying to interpolate between keyframes using blender’s timeline

If I take an existing MD2 model and import it into blender, export it to MD2 again (as a different file), then that new .md2 file will animate fine in a game engine. The default frames that are animated are 46-53, which I think are labelled as ‘attack’

Unfortunately I can’t figure out what is preventing animation from working when I start a new project from scratch. I’m currently trying to get the default cube to translate and scale so I’m doing the following

  1. Open the timeline view
  2. Go to frame 46, press ‘i’ and go LocRotScale (in object mode)
  3. Go to frame 53, translate and scale the default cube to some position and size
  4. press ‘i’ and go LocRotScale

At this point, I can drag through the time line and the cube animates fine.

  1. To the UV unwrapping and texture selection (required for the MD2 export to work)
  2. Got to frame one
  3. Go to edit mode and select all
  4. Export to MD2

The MD2 model will load fine into the game engine, but it will not animate.

I did notice that with the MD2 file that I imported into blender, that each individual frame had the vertices at a new location. i.e. there are no blender-like keyframe. Is there something I’m supposed to have done first to ‘apply’ the animation to each frame and eliminate the keyframing

I hope that all makes sense. It’s been really tough googling a solution to this one, hence this forum post.

Cheers.

google/yahoo should have a wealth of info on md2. after all, it’s the base format for the quake 2 engine & there’s dozens of games that use it.

What’s the game you’re using it for? By default, blender exports the model with the Q2 player animation frame names.

I’m using this in my own game engine and am able to import and animation other people’s MD2 animations just fine.

My problem is that I can’t get an animation in blender to export to something animated in the game engine. All the Quake 2 animation frame names are there, i.e. ‘attack’ is frames 46 to 53 and in blender frames 46 and 53 has keyframes which I use to move a cube from right to left.

This leads me to suspect that I’m not doing something right in blender.
i.e. When I’m exporting to .obj format, I often forget to go ctrl-a -> “Scale and Rot to ObData” because I tend to do a lot of scaling in object mode. If I don’t do that, the scaling is wrong in the game engine.

Is there something that I might have omitted in regards to animation before I try and export to MD2? Why might doing the steps I’ve listed not result in animation working, because if I scroll through the timeline in blender, it animates fine, i.e. my default cube translates from left to right (say)

[edit]
Success! I tried using armatures to manipulate the cube and keyframed them instead of keyframing the object itself. I now have animation in the game engine.

Still, it would be nice to know what I was doing wrong when keyframing the object.

The md2 is a vertex animation format, so every frame is a keyframe. The problem with you moving the whole object & moving it as an object is that has nothing to do with each vertex’s animation.

What’s why using armatures worked: you’re key framing the armatures & it’s moving the verticities, not the object as a whole.

So if you want to move the whole object then go in to edit mode & move all the verticities in the model.