Categories
code of the day cotd maya mel

Code of the Day: Tornado Maker

Tornado Maker 1.1 script by maya.user: http://www.creativecrash.com/maya/downloads/scripts-plugins/c/tornadomaker

Tornado Maker 1.1is a script for creating custom particle based tornado system.

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

Functionality: 7.5
The code offers quite a number of options for creating an interesting tornado shape from a cylinder and control lattice, as well as quite a lot of control over the particles and emitters. The options are quite thorough and gives quite a bit of fine grain control over the emitters and movement of the particles.

Design: 6
The code is broken up into a number of small functions which are mostly encapsulated and single use. There are however quite a few global variables being used, and in a few cases the globals are used instead of passing variables into the functions. There is also somewhat of a routing table of functions where a string variable is passed to trigger a function. However, since there is not any additional processing that is done through the function routing table, it actually makes the code more confusing, since the function requires dummy variables to be passed which are often not actually used by the function that is eventually called.

Style: 6
The formatting and indentation and not entirely consistent and in a few places the scoping of nested if statements is difficult to read since the brackets are all in the same column. The variable names are fairly good and functions are fairly descriptive which helps. There was at least one instance where switch/case statements did not use very intuitive names (such as case 1 throught to case 14). This is a little confusing to follow and is not clearly documented what each case does which leads to even more confusion.

Documentation: 6.5
The user documentation located here: http://www.worldofmaya.com/d_tornado.html is very straightforward and does a good job of explaining the tools. The in code documentation is quite sparse however, and the code itself (outside the header) are barely commented at all (would be nice to know what the individual cases were used for).

Reusability: 5
The UI seems to be tightly coupled to a number of functions, which makes debugging more complicated and reuse far more unlikely. It is really the heavy use of globals and unusual formatting that would make this code difficult to maintain or extend.

Overall: 7
The functionality exceeds the code base, the tornado script is a little bit older than some of the other scripts available, but still does a nice job creating an interesting tornado quickly and easily.

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

Leave a Reply

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