Categories
code of the day cotd

Code of the Day: Connect Poly Shape

Continuing on with more creative crash site today, I look at the Connect Poly Shape script by dirk: https://www.creativecrash.com/maya/downloads/scripts-plugins/c/connect-poly-shape

This tool set simulates subdivision modeling with polygons by connecting a low res polygon shape with a higher res version. The higher res proxy version updates in realtime to allow an artist to model in low-res polygons and see immediate updates to the high res version.

Language: MEL
Type: Maya Editor Script
Script Files: 7
Number of lines: 6437

Functionality: 9.5
There is a lot of functionality to this script set, and a lot of workflow considerations are considered, including setting the proxy object and initial objects on different display layers, heads up display information to help better navigate the tools (and current settings) and helpful options for creating quick selections, and navigating the interface.

Design: 7
The setup scripts do a good job with sanity checks to verify that all the other scripts and icons are there which more scripts should really do. The interface code would also benefit from a separation from the connection logic. Some of the functions are very long and would benefit the design and reusability to split these into smaller reusable functions. The code does a good job in checking most potential error conditions, and does a good job of outputting errors that it comes across. The most unusual part is creating a string array which is a mix of parameters and code to pass to another function (like a parser). I realize the MEL does not have good support for objects (which is what this approach is trying to mimic), but feel that a more concrete structure would be far less error prone and easier to debug.

Style: 8
The code is organized into logical files, each encapsulated to do its job. The naming conventions are consistent and the use of whitespace is appropriate in showing the hierarchy of the UI. The use of comments is appropriate and offers some good insight into a few of the longer functions.

Documentation: 10
The documentation is great and very thorough, it even has tutorials and examples of what is going on underneath the code with a basic example of how to setup the poly shape connection without the tools. The code has help and tooltips and the inclusion of hud options makes it very easy to navigate.

Reusability: 7
A number of functions are isolated, but some functions are just too large to be reusable. A lot of the code is tied to the interface and some of the unusual preset approach with string arrays makes it tricky to pass other parameters.

Overall: 9
This tool set offers a lot of functionality for modelling polygons in a way that is easy to understand and seems to be well aware of the artist workflow. Overall this feels like a very complete package and the documentation and tutorials are some of the nicest I have seen on creative crash.

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

Leave a Reply

Your email address will not be published.