Categories
code of the day cotd

Code of the Day: RockGen

More creative crash site today, I looked at the RockGen 2.0 script by Terry Stoeger: https://www.creativecrash.com/maya/downloads/scripts-plugins/modeling/misc/c/rockgen–2

This script is a neat little tool for creating rock formations with a click of a button. The number of rocks, distribution radius, sheer, noise, min and max.

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

Functionality: 8.5
The UI and options are very nice, and the results are quite impressive. There seems to be a known bug with the stalagmite option (where it fails to execute the boolean operations). The boulder and quartz options are very nice and well worth use of the tool.

Design: 8
The code is logically separated and the functionality is quite self contained within each of the functions. Some of the functions are a little long, but it would be nice to see a bit more separation of some of the generation code would help minimize any duplication. Overall the structure is quite logical and does a pretty good job of separating the UI from the rest of the functionality.

Style: 7
Some of the spacing and indentation is inconsistent spacing and indentation makes some of the code hard to read. The functions would benefit from some separation to make them smaller and better encapsulated.

Documentation: 8.5
The in code documentation is quite well done, and does a good job helping explain the code. The header on the file explains the code in an appropriate manners and overall increases the value of the code.

Reusability: 7
There generator functions are tied to the UI which makes it somewhat difficult to reuse. The overall code base is quite small and powerful which makes it easier to adapt, but otherwise is closely tied to the interface and would require some modification for expansions or fixes.

Overall: 9
The functionality is pretty cool, and while it would be nice to see the stalagmite rocks, the quartz and boulder are really neat and in general is a fun tool to play with. Likely after using this tool, you will never want to model a rock again.

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

Leave a Reply

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