Maya + Wii Nunchuck + Arduino + Processing…..

4 simple steps to somewhat useful mocap for maya...

After watching the behind the scenes features to the latest Star Trek, I was struck by a couple of things. First, how JJ Abrams created that heightened sense of energy by constantly drumming on the camera during takes. Second, how the guy at ILM (sorry didn’t catch the name) had an accelerometer on his desk to add in that drumming to cg shots.

Now, I don’t know how much that little device was used or the level of it’s role in the film, but I thought it seemed like a pretty good idea. I had been toying with using Processing to issue commands to Maya a while back and thought I should resurrect some of that now. I’ve got some history using an Arduino and a while back I picked up a little $4 connector to hook a Wii Nunchuk to it thinking it may be useful somehow in the future. I put two and two together and got this little app built in a couple days of free time.

The Arduino app is pretty barebones, it needed to fit on the original Arduino w/ less than 8k of memory. All it does is stream out the state of all the sensors on the wiichuck at it’s full baud rate. That data is captured by the Processing app and it’s all plotted and visualized as follows:

4 simple steps to somewhat useful mocap for maya...

Once I had that running it was a matter of creating a Maya commandPort and connecting to that in Processing to feed the proper MEL commands to handle realtime rotation/translation of an object such as a camera. Hitting the Tab key will start playback in maya and generate keyframes as you’re doing your thing. The Processing app handles everything once you open that port in Maya.

Now, I’m not the most clever person around so I may be missing something but since Maya on OS X does not have a mocap server built in (unlike the other platforms) this seems to be the only way to do that. Perhaps there is a way to write a Python plugin to do this natively inside Maya, but then you don’t get the cool graphs that really make it look like you’re doing something fancy….

It isn’t straight up plug and play, you have to get your Arduino set up, load the app, make sure your serial port is correct in the Processing app and make sure it’s talking to Maya correctly. However, once that’s done you can open up a lot of doors with how you use it. Right now I create a locator and use it’s motion to augment camera animation… but the joystick could be wired to blendshape sliders or whatever you want. It’s the nunchuck though so you’re limited to roll and pitch. And it’s not the best accelerometer in the world so there’s a lot of noise. Specifically it’s not bad for adding in that little bit of organic tilt and handheld look to an established shot..

I make no guarantees, nor do I really offer any kind of support for this. Technically it SHOULD work on every platform, but I only have access to OS X so that’s what I know, but there’s no reason it shouldn’t work on windows and linux… I can’t pretend to know how to fix anything, but in any case I would probably try to help you out if you need it and seem like a nice person… Here is everything you’ll need to get started:

1: Arduino with USB: $29 – I get mine from sparkfun!
2: WiiChuck adaptor: $4 – Bunch of places to get it listed on this page. (hook it up just like the picture shows…)
3: Wii Nunchuck: you can get those many places…
4: Arduino IDE: Free!
5: Processing: Free!
6: Maya: Not cheap!

Here are my apps:

Processing App -> wiiChuckToMaya_v03.zip
Arduino Sketch -> wiiChuck_v03.zip

In addition you’ll need to get and install this for the Arduino -> Tim Hirzel’s WiiChuck.h library

That should about do it, I think. It seems like a lot of setup but it’s not that big of a deal. Big thanks to Todbot and Tim Hirzel for doing most of the groundwork on using the Wii Nunchuck.

Let me know if you use it for anything handy, I’d love to hear from you… otherwise, enjoy!

One Response to “Maya + Wii Nunchuck + Arduino + Processing…..”

  1. using processing, wii remote, to issue commands to Maya - March 15, 2010

    [...] out the project on his site Mostly Finished, where he makes the files available for download. In addition to these files, you will [...]

Leave a Reply

You must be logged in to post a comment.