The aim constraint in action.

Custom Aim Constraint

custom command

custom command

Over the past few weeks I’ve been diving deeper into Maya’s API. The driving force behind much of this effort has been my need to program increasingly more complex nodes. Specifically I want more and better control over the tools and rigs I’m making.

The aim constraint in action.

The aim constraint in action.

In this example I used an MPxLocatorNode as a starting point for a custom aim constraint node. My goal was fairly straight forward; create an aim constraint with an object up vector and toss in some OpenGL drawing to boot.  As an extra bonus I added a command for creating the node.

I chose to use this particular node because of it’s built in OpenGL drawing. It allowed me to create a toggle-able debug draw feature, which can be seen in the image to the left.

The fun part of this project was the math. I saw it as an opportunity to brush up on matrices and vectors. For anyone in need of a refresher I strongly suggest Khan Academy!