AutoTangent 1.0.3 script by martin freitag: http://www.creativecrash.com/maya/downloads/scripts-plugins/animation/c/autotangent
AutoTangent 1.0.3is a script for changing selected Graph Editor Keys to a smooth tangent.
Type: Maya Editor Script
Script Files: 1
Number of lines: 242
There are only two main options (flattening start and end keys, and a slider for setting the softness), yet the functionality is very helpful, and in some ways feels like it should be built into Maya as a default option. The results are good, the keys smooth nicely without overshooting.
The code is broken up into a number of functions, the UI is small and compact and the code does not use too many variables (one global variable). There are a few magic numbers (specifically 3.0) that doesn’t seem to have much documentation on why it was used either. The error checking handles most cases generally. The main function is fairly long and could have a few areas broken up into smaller pieces to make them more reusable and smaller more robust code base.
The formatting is a little inconsistent and the spacing and indentation (especially on the comments) do not seem to follow a consistent standard. There are areas of the code (mostly print statements) that are commented out, which just clutters up the code base.
The header documentation is decent and some of the comments in the code are pretty good. For being a small file it is not too bad, although it would make for a nicer read if there was not any commented code left in the script.
The code is tightly coupled to the UI, and the use of global variables means than no function is capable of reuse without the rest of the code base. Maintainability wise, the code base is tiny, so would be easy to update or modify any bugs as required.
Quick and helpful little script for quickly modifying animation key tangents. In some ways I would not be surprised to see this functionality eventually built into Maya, as it sounds like other packages (like MAX) already have a similar function. It can be a useful little script for now.
Until next time,