Main

January 27, 2007

Rag Doll Physics Simulation

My muscle system creature rig has gotten put on the backburner for a while. I ordered the MuscleTK plugin for Maya and the software arrived fine, but I could never get the cgToolkit people to send me an activation code. After two weeks of e-mailing them myself and having the store where I bought the software e-mail them and getting no response, I returned the software (kudos to the company I ordered it from, they were awesome!). I'll give Michael Comet's plugin a try next, but I need to save up for a little bit to afford it.

So, the next bit I'm playing around with for my demo reel is a rag doll physics simulation. Something similar to the basics to Natural Motion's Endorphin, but done as a Maya plugin. Initially, I just want to get the basic physics in place; I'll see where it leads me after that.

Here's the first test. I thought I'd try YouTube as a repository for some of my video tests. There's no real physics going on here, just a dampening of the oscillation. This is really just testing out my infrastructure (making sure I know how to connect things up correctly and drive joint rotations properly).


Hmmm. The YouTube embed doesn't show up in my RSS reader (GreatNews)...

This is what it looks like in the hypergraph:
Rag Doll Simulation Hypergraph Shot

I'll post again once I get some real physics dropped in.

January 01, 2007

RigBuilder redesign

I've been working on some rig generation scripts for biped characters. They started their life as scripts that were driven by shelf buttons. The options were hardcoded into the shelf button. You wanted to change the angle/offset/size of a controller, you had to edit the shelf button. Building a complete rig consisted of pushing several shelf buttons. You can see it in action building several rigs in my demo reel.

When I started building a UI around the scripts, I had two main design goals which were:

        1. Easy to change the rig on a limb by just changing a selection in a list. You have IK and you want switchable FK/IK? No problem. Change a selection, regen the rig and off you go.

        2. New rig designs were easy to code and you just drop them in. Each rig subsytem was self-contained - no code changes to hook them in.

When I first started out the project, I couldn't figure out how to meet the second goal. I had a number of .mel scripts. How to tell when a new one had been added? How would I find new rig scripts and figure out what they were? Since MEL doesn't have anything resembling reflection (except for the 'whatIs' command), getting this done seemed pretty difficult.

So, not wanting to get blocked, I punted on the problem. I made the interface to the rig files as simple as possible (each limb e.g. arms, legs, back, etc) had a specific signature for building and that was that. To add a new arm type, you had to go to the menu for arm types, add the string you wanted and then go to the code that looked at the options and add a new clause to the if-then-else and call the new function. Not great, but not terrible.

As work progressed, I accidentally did a really good thing. I separated the scripts into subdirectories: one for the arm modules, one for the leg modules, etc. Then I explictly traversed the directories with 'getFileList' and sourced the .mel files I found.

As I was finishing up the demo reel, it hit me. I could use the 'whatIs' command and query if certain methods existed. Since I was explicitly sourcing the .mel files, I had their name. If the methods I was interested in were prefixed with the file name, that was all I needed.

So, now the interface to a subsystem is pretty simple:

    - a build proc

    - a display options proc

    - a save options proc

    - a couple of procs to get menu strings and stuff

Now, the main generator is completely generic. You want to add a new a new rig type for a limb? Just code up the functions and drop it in the correct directory. It automatically shows up in the UI and is available.

Now of course, the connections are more subtle. Particularly between the skeleton and the rig types. I've eliminated a bunch of the naming problems by automatically selecting the best joint I can find, based on name. However, if the skeleton has a different naming scheme, the rigger can just select the right joint in the rig builder UI. But what if you want a ribbon spine and there's no nurbs plane for the ribbon? You the build just fails. The whole connection between the skeleton and the code is too tight and too implicit.

Something to work on for the next version.

December 28, 2006

Demo Reel updates

As I was putting my demo reel together, more than once I thought that I should post fragments of the reel or my thought processes, or progress reports, or whatever.

So, as I work on new stuff, I'm going to start posting it to this blog. If nothing else, it should help me post more regularly.