|Beyond the Rosetta Stone|
In The Movies Game animation files, the rotation and location of bones of an armature are described in terms
of a coordinate system in which X points to the right, Y points upstage (the back of the set) and Z points up.
The rest position of an armature bone is along the X axis, with a rotation of -90 degrees.
Elsewhere, I have described the relationship between the coordinate system used by The Movies Game and how we can use the T-pose in the file sm_pose.anm to compute the coordinate transforms between the game data and the blender armature. This was implemented as a submodule called "bonelist.py" which is used by the import and export scripts for import to and exporting from blender the animation data in the Movies Game animation files(.anm). This technique solved the problem for the costume armatures in the game, which are basically all the same for all human characters. There are, however, other bone animated figures, including horses, and dogs. Since there is no T-pose animation for these figures, other information must be used to compute bone transform data.
In an online discussion with Sexymaria, she suggested that it might be possible to extract the transformation data from the mesh files. All that is known about the mesh files is incorporated into the import mesh script developed at DCModding in days of yore, primarily the handiwork of Gleem, so I studied the import script to see how the armature information is extracted from the mesh files (suffix .msh). Looking back at the problem now, I have forgotten how I managed to figure it out, but it appears that the script extracts a matrix from the mesh file that describes the orientation of each bone relative to its parent. I modified the script to write out the bone matrices to a file and then wrote another script (qbrs_from_mesh.py) to convert them to quaternion data. I ran these scripts for each of the game armatures and created tables of bone orientation quaternions in the module bonelist.py. The correct set of transforms can be identified for each armature by looking at the number of bones in the armature.
Unfortunately, I did not document the process at the time, so all I have to go by now is the scripts that were used. The purpose of this article is to remind me how this was done, in case I ever have to repeat the process. Since the necessary data for all the bone armatures is embodied in the latest version of bonelist.py, it will probably not be necessary to repeat the process, unless errors are discovered or some one identifies an armature in the game that has not yet been converted.
Download the blender python scripts used for this purpose here.