Mirror Animation (with preview and separate body part options)
This Mirror Animation tool allows you to mirror full body, individual body limbs, and/or sections of animation on a character rig.
The tool is composed of 4 sections; the first being motion file and character rig selection. All selectable character rig options are drawn from project folders, that exist in a set folder structure that I have put together for the studio I work at. These character rigs are all grouped based off of project, and as you select a project in the project dropdown, the character rig dropdown updates with all of that project's current character rig options. The selected character rig will be added to the scene, and it's animation will be set to whichever FBX motion file is selected using, the '...' file selection button.
In addition, the tool has a refresh button. This is the green button next to the character rig dropdown; Said button will update the scene should an alternate character rig be desired.
A few sections contain expandable UI elements:
that give the user more mirroring options. Every option available can be previewed before the tool ultimately bakes animation down to the character skeleton and exports out an FBX file.
Additionally, this tool supports version control, as the studio it was developed for had multiple projects that all used different versions of Maya. Older versions of Maya and MotionBuilder will not recognize newer files; for instance, Maya 2014 will not recognize an FBX saved out by MotionBuilder 2018. FBX's are the file format used by a custom Animation Importer that I had written to import mocap data onto our character rigs inside of Maya, and these FBX's need to be the same version of whichever Maya the animator was working in, so all exporting from MotionBuilder has to support generating FBX files of all version types.
Once a motion file is selected, the name and location of the new mirrored animation file are listed at the bottom of the tool. (The mirrored file will be saved out in the folder that the original motion file was selected from.)
The 'Mirror Options' section of the tool contains all body mirroring options: full body, upper body, and lower body. As an option is selected, the character will automatically update in the scene:
Ex: Full body:
The upper body can be further broken down into three individual options: left arm, right arm, and head.
In addition, the tool also allows for mirroring portions of animation via the 'Mirror Portions of Individual Limbs' section. In most moves, esp. any that involve the character walking or running, you would not want to mirror only the upper or lower body, as the arms will no longer move correctly with the legs when the character is walking. However, if there is a portion of a move that you want mirrored from one arm to the other, for instance the character is walking and blasts a beam from his left hand, but you want it to blast from the right, the tool allows for this sectioned mirroring.
When one of the section selection buttons is clicked, an anim layer for that particular limb is created in the scene:
Inversely, if the button is deselected, the anim layer is removed.
This new layer is where keys should be set to mark out which portion(s) of the animation should be mirrored on the layer's respective limb. Once all keys are set, clicking the 'Enable' button for the appropriate section...
...will establish a preview of all mirroring for the sections of the animation denoted by the layer's keys.
The tool assumes the user is selecting portions of animation that will mirror with minimal pops, and will smooth out all mirror blend spots after all aspects of mirroring have been confirmed by clicking the 'Mirror Animation' button.
The 'Clear Keys' buttons will clear the keys from their respective anim layer, as well as select the layer so that the user can rekey the portions of animation they want mirrored.
In addition, the 'Problems keying? Click Me' button can be used to troubleshoot any keying issues. This button selects all joints associated with the character in the scene, which gives the user something to key. As long as one joint in the skeletal hierarchy of the character is keyed, said key will be acknowledged by the tool when determining which portions of animation to mirror for the anim layer's given limb.
Lastly, if the UI window should be closed without selecting to 'Mirror Animation', the scene will be cleared of all animation, animation layers, etc. (via appended code to the window's close event).