top of page
  • Grey YouTube Icon
  • Grey Instagram Icon
  • Writer's pictureThiago Araujo

Maya Joint Baker Tool

Updated: Sep 12, 2023

Introduction

In the field of technical art and software engineering, simplicity, modularity, and reusability are key. In this blog post, I'm excited to share a Maya tool I created based on a request from a teacher during my time at BCIT. This tool focuses on recursively baking joint rotations and demonstrates how a well-organized project can enhance even the most straightforward tasks.

 

Purpose

This small tool's purpose is to recursively iterate through a joint structure, efficiently baking the rotations of each joint into either its orientation attribute or offset parent matrix.

A distinctive feature is its masking system. By inputting specific predicates, such as 'hand' not in joint or joint.endswith('END'), users can direct the tool's behavior, granting them precise control over which joints undergo the baking procedure. This empowers users to fine-tune the joints subject to the procedure, enriching the tool's flexibility and utility.

 

Architecture

The project embraces a modular design that encapsulates each critical aspect of the tool within distinct modules, harmoniously woven together to create a robust and easily extensible solution.


Core Package

This is where the tool's main functionality resides. Usually my tools are at divided between a builder and a controller class. Any more complex design spring from core design.


tool.py: Builder class with public variables serving as customizable settings and methods executing the bake process upon a straightforward build method invocation.


panel.py: Adhering to MVC's controller pattern, this UI script establishes a Maya UI layout, linking widgets directly to tool variables and methods.


Widgets Package

Creating custom widgets for my tools is a regular practice. To promote modularity and reusability across my scripts, I abstract them into individual modules. These widgets typically follow a consistent design pattern: a class with a factory method that constructs its UI elements and, similar to Maya UI commands, returns the main layout ID to the user.

In this project, I've integrated the subsequent custom widgets:


title_bar.py: This widget defines a title bar with an informative tooltip on hover, enhancing user experience.


evaluated_text_field.py: This is a interesting widget augments the regular text field with a dynamic validation checkbox. The checkbox changes color based on input validity and can trigger events upon validation, allowing for versatile UI element control (like disabling buttons if the validation fails). The user is able to provide a predicate to this widget that is used to validate the string.


toggle.py: This module introduces a toggle widget featuring customizable on and off buttons. Users can rename these buttons and link different events to their respective presses.


Recursive Framework Package

This is a small package containing only one module so far, the idea is to build this package up with a series of different recursive iterators that iterate over different Maya object structures like: skeletons, DAG objects, nodes, etc...


joint_iterator.py: This module is responsible for iterating through a joint structure recursively. When provided with a joint name, it iterate over the skeleton structure, fetching information about each joint, its parents, the entire joint chain leading to the current joint, and the joint's depth.

 

Conclusion

Of all the solutions and pipelines we build, even a seemingly simple tool can evolve into an exemplary project through thoughtful design and a commitment to modularity. This Maya tool showcases the power of encapsulation, organization, and reusability. Its architecture not only streamlines the current task but also sets the stage for future expansions and enhancements.


To explore this tool further, you can visit my GitHub project page.

And to use it, follow these steps:

  1. Download its files into a Maya plugin folder.

  2. Enable the plugin within Maya.

  3. Execute the command cmds.open_joint_baker_window() to open the tool's window.

  4. For quick access, consider pinning the command to a button on a shelf, allowing you to effortlessly launch the tool whenever needed.

Comments


bottom of page