Categories
code of the day cotd

Code of the Day: Zoomerate

Creative crash site again today with the Zoomerate script by mooKid: https://www.creativecrash.com/maya/downloads/scripts-plugins/c/zoomerator-mel

This script creates an interface for a camera to track, pan and zoom a camera quickly (in the x, y, or z axis). The interface allows any camera to be selected, and provides an option to reset the camera.

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

Functionality: 7.5
The functionality does a pretty good job in setting up some quick options on the camera. I tried it with some more complex camera setups (with some additional constrains and locked nodes) and it had some issues with setting those values, but those could be easily fixed if necessary.

Design: 6.5
The code does an alright job with some errors but does not handle some other uses of the script and some additional error checking would be nice. The camera logic and interface are tightly coupled which would have been nicer to see some separation or application of MVC, but otherwise is alright. The code is separated into three main functions which seem well organized.

Style: 8.5
The code style is very appropriate, and the use of indentation and whitespace is handled nicely. The code uses logical names for variables and functions and is quite easy to read and understand.

Documentation: 8
The documentation and inline comments are suitable and help explain part of the code and the usage in a useful way. The code does rely on the user knowing how to source the script properly (since it does not run correctly if invoked directly in the scriptEditor) but still does a decent job of explaining itself.

Reusability: 7.5
The code base is small, but is also tightly coupled to the interface. Separating out the actual camera movement from the interface could help with maintenance, but otherwise is fairly straightforward.

Overall: 7.5
The functionality is quick and easy to use and gives a nice result. While it is not a complex camera system, or a lot of features, what it does provide are some nice additional controls to camera movement to make pans and zooms a bit simpler to work with.

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

Leave a Reply

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