The Movies animation files (*.anm) contain bone animations and prop animations. Bone animations use an armature and the location and orientation of each bone is specified for each frame in the animation. Since most armatures have lots of bones and animations can have hundreds of frames, that amounts to a lot of data. In order to save space in the files, the key frame data is compressed to fit into a 16 bit signed integer.

int16 = float/compression

where "compression" is the largest absolute value in the data.

For rotation data, the range of angles is restricted to -180 to 180. The compression factor is 180, so all stored values are between -1 and 1. Since any angle can be reduced to the range -180 to + 180, the compression value for angles never changes.

For location data, however, the situation is more complex. It is desirable to use as small a compression value as possible because that gives more precision in specifying location, but in any case, the compression value must be set so that the compressed values all lie between -1 and 1. The solution is to scan the location data for the animation, find the largest datum, divide all values by the largest absolute value, and save that value as the compression factor. When you read the data from the file, you only have to multiply each compressed value by the compression factor to recover the original floating point data (with some loss of precision).

When we edit an ANM file, it is easy to exceed the dynamic range allowed by the original compression factor from the file we read in. If the compression factor is too small, the out of range data will be truncated to either -1 or +1. While working on my airplane prop animations, I was forced to deal with this problem because when I tried to put a pilot in the front seat of my Jenny prop, I could not move him high enough off the ground without exceeding the dynamic range of the compressed data. I had to hack the target file to increase the compression factor.

However, a better way to avoid data truncation problems is to modify the export script to compute the best compression factor for each animation and use that to output the modified ANM file. You can then freely move the character or prop around the stage, or up and down. The downside is that the higher the compression factor, the lower the precision of the stored data and closeups might get a little jerky, so don't overdo it.

The bottom line is a new version of anmexport (v. 5.1.4) is now available which will compute the optimum compression factor for each animation in the target file. You can download the latest package with the updated anmexport script at the link below:

I tried now to animate the 'Root' bone by moving the actor mesh from a considerable distance, and the result is that it works! How many new scene & animations are now we able to make. Thank you very much for sharing this!