code of the day cotd

Code of the Day: Clay Dough Mel

clay_dough.mel 1.5 script by man0war:–2
Clay_dough 1.5 is a tool for emulating magnet fall-off deformers, creating a clay-like process for modifying geometry.

Language: MEL
Type: Maya Editor Script
Script Files: 3
Number of lines: 1681

Functionality: 9
There are not a lot of functions, but the end result is quite impressive and really does make the selection move and feel like clay. I think this is a very nice approach for working and creating non-uniform organic forms, and can rapidly generate some interesting selections to stretch and squash polygons, nurbs, lattices and curves. There are also options for installing the shelf, but the real result is the clay dough effect.

Design: 6.5
The code is quite logical in its file separation, and each function set it nicely encapsulated within each of the files. The function length on a number of the clay methods, is a bit long, but overall are fairly self contained. The nesting depth of some of the function logic was quite long, and some of the loops within loops would make the algorithmic performance suffer (in a few places the nested loops were 8 loop levels deep) meaning on a very large data set this would not scale very well.

Style: 7.5
The code style is actually pretty good, and is spaced and commented in a consistent manner. The naming conventions used and commenting were in a few places a little unusual, but overall the style of the code would benefit a bit from smaller functions design as the individual pieces are fine, but when put on a large deeply nested function, end up adding large comment blocks to break up the code logic instead of just separating out the function.

Documentation: 8.5
The code documentation is pretty good, although there is a number of places where there are significant comments after the main functionality of the code, which is a little unusual (usually all the information is in the header). The separate documentation is nicely formatted html with lots of pictures and helpful guidelines on how to use the tool and install the shelf button.

Reusability: 7
The script size is not massive, but there are not a lot of standalone functions that could be used in isolation. The code in a few places is a little too nested which could make updates and bug-fixes more difficult to test and apply. The script comments and style do help maintain the structure, but likely new features or fixes would prove to be a bit time consuming from the design of the code.

Overall: 8.5
The tool does one thing really well and that is great. I was actually impressed by the results, as I did not expect to see such clay-like deforms happening so smoothly when I first tested the tool. Definitely a tool to check out for its functionality, although it would rely on a particular workflow for an artist to use it regularly (it is fun to play around with though).

Until next time,
Michael Hubbard

Leave a Reply

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