Homeworld Effects Manual: setMeshAnimation()

setMeshAnimation(string name, float framerate, int repeat)

Sets up a mesh animation

This command requires some setup earlier in the file. You must make define what exactly name means. This is done with a label() statement, a number of morphAnimDWORD() statements, and int 4294967295 to mark the end of the animation. Here's an example from a custom deathEvent:

label(icf)
    morphAnimDWORD(ETG\meshes\ships\shadows\ioncannonfrigate.peo, 1)
    morphAnimDWORD(ETG\meshes\ships\shadows\ioncannonfrigate.peo, 0)
    morphAnimDWORD(ETG\meshes\ships\shadows\ioncannonfrigate1.peo, 0)
    morphAnimDWORD(ETG\meshes\ships\shadows\ioncannonfrigate2.peo, 0)
    morphAnimDWORD(ETG\meshes\ships\shadows\ioncannonfrigate3.peo, 0)
int 4294967295

framerate is the number of transitions per seconds. If framerate is 1, the mesh will start on one mesh and will completely morph to the second in one second. repeat is the number of times the animation is allowed to repeat. It's not really an int. It will take floating-point values, but it will truncate them, so you can't actually make a mesh animation loop 1.5 times.

Obviously, this command should only be used if you plan on creating a Mesh object. I used this command to make Shadow ships shrivel up when they died.

If you want the animation to loop, make sure the first and last frames are similar. The animation does not go down the list of frames and then come back up; it goes off the bottom and starts again at the top. This can cause jerky transitions if you aren't expecting it.