code of the day cotd

Code of the Day: FBIK CharacterControl

Continuing on with the creative crash site today, I wanted to continue a bit more with some asset creation tools, so downloaded the popular FBIK CharacterControl by shinsenTarou:

The script is a UI for character building similar to a feature like Motion Builder. This offers a UI for selecting specific rig controls (rig file included) and options for creating and loading poses, setting keys, selecting IK or FK nodes and overall control over the human.mb character. Other rigs are included (such as a quadruped), but the interface is based of a human biped character.

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

Functionality: 8
The code creates an interface to quickly select and create poses for the rig file included. The overall interface is nicely laid out with features for creating and setting poses, quickly grabbing multiple parts of the rig through the interface. The UI has tabs for Body, Hands and Feet, selection for FK or IK, and keying whole body or selection.

Design: 8.5
The code is organized into logical functions with appropriate parameters and return values. Many of the functions have encapsulated functionality which offers a great deal of code reuse. Some elements of the design are still closely coupled with the interface, but are handled in such a way to keep these isolated from the rest of the code. Some functions use a few magic strings which would be better set as constants, but otherwise is well organized in design.

Style: 9
The code is very organized and easy to read. The use of whitespace is consistent as is the decorators above each function. Some of the code could benefit from some additional comments, but since most of the functions are small and concise this is more of a nice to have. The naming conventions between public and private procs borrows a little bit from python in its use of underscores, but is nevertheless consistent.

Documentation: 8
The Install.txt file gives information about how to install the shelf and icons, but the code could do with a little bit more documentation. The code is well organized and somewhat self-documenting, but some additional information would be useful.

Reusability: 7
Due to the small and reusable design of the functions, a lot of this code base would be easy to maintain. The interface specific stuff is tied specifically to the hierarchy of the UI, but otherwise is encapsulated away from the rest of the code. Creating different skeletons would likely involve some heavy modification to the UI. The interface also seems closely tied with the rig, which would require updating the UI, code and rig for any modifications.

Overall: 8
The functionality is useful, and the example maya files are helpful in displaying the functionality of this tool. The code base is very easy to read and benefits from a logical design. Some of the functionality is similar to other tools, but overall gives a nice example of a Motion Builder like interface in MEL.

Until next time,
Michael Hubbard

Leave a Reply

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