- Autodesk Maya (Tested with Maya 2020-2024)
- Python (python 3 and above)
This script provides a simple tool for transferring animations between different character rigs in Autodesk Maya. The script works by comparing hierarchies and transferring animation from a source rig to a target rig.
- Clone the repository or download the script file.
- Open Autodesk Maya.
- In the Script Editor, load the Python script file.
Target character model to which user wants to apply animation should have the same naming and the hierarchy as the character that animation was recorded with.
The script opens a new window in Maya named "Animotive Animation Transfer". It contains several UI elements for easy usage.
Click on the "Select Target Root" button, then select the root object of the target rig in the Maya viewport. This is the rig you want to apply the animation to. The selected object's name will appear in the text field.
Click on the "Select Animotive Export Root" button, then select the root object of the source rig in the Maya viewport. This is the rig that already has the animation you want to transfer. The selected object's name will appear in the text field.
Click on the "Select Root Bone" button, then select the root joint of the target rig in the Maya viewport. This is the root bone you want to apply the translations in addition to rotations to. The selected object's name will appear in the text field.
Click on the "Apply Animation" button to transfer the animation from the source rig to the target rig. This process may take a while depending on the complexity of the rigs and the length of the animation.
Note: If no objects or multiple objects are selected when selecting the roots, an error message will appear, prompting the user to select a single object.
-
Reset Rotations: Resets the rotations of all animated objects to their initial state.
-
Parent Constraints Creation: Creates parent constraints between corresponding objects in the source and target rigs, ensuring that the animation is transferred correctly.
-
Parent Constraints Deletion: Deletes the parent constraints after the animation has been transferred, allowing the rigs to move independently again.
-
Time Reset: Resets the current time to 0 before starting any operation.
This is a Maya script that aids in transferring face animation from a JSON file to a character within Maya.
To use this script:
- Open the script in the Maya script editor.
- Execute the script. This will open file browser for you two choose json file that's exported from Animotive.
- Once you finish the step 2 it'll automatically open a GUI with two buttons.
- In Maya, select the root of the target object to apply blendshape animation, then press the "Select" button in the GUI.
- Press the "Apply Animation" button in the GUI to apply the face animation from a JSON file to your character.
The script contains the following functions:
select_target_root(*args)
: This function sets the root of the target model.get_blendshape_node_from_geo()
: This function retrieves blendshapes attached to the selected target root.set_playback_speed()
: This function sets the playback speed based on the number of frames in the facial animation.set_keyframes_from_json(*args)
: This function reads the JSON file and applies the facial animation to the target model.
The JSON file should contain information about the facial animation, including the blendshapes used and their values at each frame.