Categories
code of the day cotd

Code of the Day: AutoSave

AutoSave 1.0.4 script by NicoMaya: http://www.creativecrash.com/maya/downloads/scripts-plugins/interface-display/c/auto-save

AutoSave 1.0.4 is an option for enabling a scriptJob to fire on “selection change” or “recent command change” and options for how many hours, minutes and seconds to perform and autosave.

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

Functionality: 8
The options are useful, and the ability to set such specific increments of time makes the script quite useful for artists that have different work schedules, or allowing it to be tweaked for certain types of work. The use of scriptJobs is expected here, and the code base is quite good about checking for its use.

Design: 7
The structure of the code is quite organized, although a few functions appear to do a little bit more (or in some cases less) than I would expect. The code base is quite organized, although in a few cases I felt that the use of eval may not be necessary, and would make the code a bit easier to follow.

Style: 8
The code is quite organized, and the use of whitespace makes the code easy to follow. There are a few areas (such as the use of cases with 0, 1, 2) that could be a bit more descriptive, but the variable names are descriptive and appropriate. A few areas of the code would benefit from additional comments. but the overall structure helps reveal the structure of the code.

Documentation: 8
The documentation is quite easy to follow and has information for various operating systems, which is helpful. It would be helpful to have additional comments within the code, but the code base is quite small and functions fairly descriptive so it is not quite as necessary.

Reusability: 8
The use of scriptJobs and evals makes the code more difficult to reuse in parts, but a few areas are quite logical and would be easy to maintain. Additional comments would help make the code easier to maintain, but with the code base being so small, it would not be much of a problem.

Overall: 7.5
The functionality is quite helpful for those looking for an auto save, and has some nice features in setting the time which would certainly help different people who work at different speeds. Some additional options for doing auto incremental saves would be nice to have. The use of selection or tool change is a good approach, although in python a threaded approach may also be an optional and perhaps more consistently timed way to approach the problem.

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

Leave a Reply

Your email address will not be published.