Pages

Thursday, February 16, 2012

Code of the Day: Spiralizer

Spiralizer 1.2.0 script by marble: http://www.creativecrash.com/maya/downloads/scripts-plugins/modeling/misc/c/spiralizer

Spiralizer 1.2.0 is a MEL script for creating a spiral of any NURBs surface.

Language: MEL
Type: Maya Editor Script
Script Files: 2
Number of lines: 103

Functionality: 6
The script takes a NURBS surface and creates a spiral curve based on the surface and the only option in the window "Number of turns". The result is quite nice when used on simple NURBS surfaces, but a few more options would improve the usability of the tool. More complex NURBS appear to produce more unexpected results. The fact that it replaces the NURBS surface that was selected can in some cases be a little less user friendly than giving the user the option to keep the original.

Design: 6.5
The code is split into two files of about ~50 lines each. Each file only contains one function, but it is still a decent separation of UI and the rest of the code. One thing that was a bit unusual was creating a number of empty labels for spacing rather than using any of the layout options (such as formLayout) to get the spacing in the UI.

Style: 6
The code is tiny, but what is there does not appear to have any code indentation. The UI however is indented, but the if statements and rest of the code body is all on the first column. I am not sure if this was intentional or not, but I found the button name "cButt" to be an unusual choice.

Documentation: 7.5
The code only comments one function but that it really all that is necessary. The code comes with a readme for installation as well that is pretty straightforward.

Reusability: 7.5
The code is tiny and would be fairly easy to maintain and debug as this is one of the smallest scripts I have reviewed. Overall, it would be trivial to debug or maintain this code.

Overall: 6
The result is decent for simple surfaces, although it would be great to have some more options (especially not deleting/modifying the original NURBs surface. This is a very specific tool, but gives a quick and nice result for what it does.

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

No comments:

Post a Comment