code of the day cotd maya mel

Code of the Day: Batch Animation Transfer

Batch Animation Transfer1.0.0 script by daagom:

Batch Animation Transfer is a script that takes a folder of animations and applies a new rig and copies over the animations (requires that that the names match on the new and old rig).

Language: MEL
Type: Maya Editor Script
Script Files: 1
Number of lines: 288

Functionality: 5.5
The code relies on naming conventions for transferring data which is fine, but only works with maya binary files. It also seems to import the rig and animation files which may not work well with a reference workflow. The code does not give a lot of options on how it is transferring the data, but copies the new files into a separate directory so that is does not modify any of the original files. It would also be nice to have some more control over how the new files are named (if they could be named identical to the original it would be better than an additional prefix being added), which in most cases would likely have to be removed again afterwards.

Design: 6.5
The code base is quite small but the functionality is still broken up into useful functions and has some separation of interface and the rest of the code base. There are a few odd places where variables are being passed to functions that never use them, and there are a number of global variables mixed into the rest of the code.

Style: 7.5
The code style is well organized and follows its own standards quite well. Formatting is consistent and most variable names are named appropriately. There are a few places where magic numbers and strings are used, as well as evals, but otherwise is fine.

Documentation: 7.5
The code documentation is pretty thorough and a lot of the code is appropriately commented. There are a few places where there is code that has been commented out, which is better to remove or mention why it was commented out, but otherwise the comments do help in better understanding the code.

Reusability: 6.5
The code globals, and coupling of the interface makes it unlikely that any of the functions would be reusable in isolation. In terms of maintainability, the code base is very small and well documented, so any extensions/bug fixes, should be fairly easy to maintain.

Overall: 6
Overall, the script works only in certain workflows. If you are using maya binary (.mb) files, or a referencing workflow, it is unlikely that this script will be appropriate.

Until next time,
Michael Hubbard

Leave a Reply

Your email address will not be published. Required fields are marked *