Categories
code of the day cotd maya mel

Code of the Day: AE Skin Weights Transfer

aeSkinWeightsTransfer1.0.0 script by AndersEgleus: http://www.creativecrash.com/maya/downloads/scripts-plugins/animation/c/aeskinweightstransfer

aeSkinWeightsTransferis a script for exporting and importing smooth skin weights in Maya by comparing the world space positions control points.

Language: MEL
Type: Maya Editor Script
Script Files: 4
Number of lines: 1602

Functionality: 6
The export does not have any options, or a UI, but relies entirely on selection. The importing and exporting works well, and the importing has some nice options for averaging and the influence of the transforms. It would be nice to have a bit more control over what is saved to the export and the file it is saved to, but overall works well enough.

Design: 6
The logic is separated out into the four scripts and does a good job of keeping the tool organized. The format of the script is a custom format based on whitespace and a custom spacing/naming that has some similarities to XML, but does not appear to follow any standard conventions. The file is saved as a .ma file, which is also a little bit confusing as it can not be read by Maya. A significant portion of the code is dedicated to this custom format, which may have been better spent working on a standard format (like XML, JSON, etc.). Otherwise, the code has a number of standalone functions which work well with the rest of the code, and most of the UI logic is separated (except in a few places).

Style: 8
The code style is pretty good, and is quite consistent. There are a few places were the code is a bit long in places (usually the import and export functions), but the rest of the code is pretty straightforward and easy to follow.

Documentation: 9.5
The code documentation is great and goes through each of the details of the UI as well as some tips on how to use the code as well as documentation on parts of the code that might be confusing. The installation instructions are thorough and the rest of the documentation is pretty straightforward.

Reusability: 7.5
The code has a number of functions that lend themself to reuse. The code would be more extensible if it was using a standard format instead of the custom .ma file format, but otherwise is pretty good. The documentation and comments also improve the chances of finding and debugging errors.

Overall: 7.5
The code quality is pretty good, and the functionality gives a nice result, with some useful options on import. I think using a standard file format for the data would cutdown on the complexity of the codebase and make it more extendible, but otherwise gives a nice result for transfering weights.

Until next time,
Michael Hubbard
https://michaelhubbard.ca

Leave a Reply

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