" /> Timing and Spacing: January 2007 Archives

« December 2006 | Main | February 2007 »

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 22, 2007

A bit of older artwork

I was rummaging through the room we call "the library". It's basically one of the two rooms where I keep all my junk (the other being "the office"). I stumbled across this old drawing I did at a SAFA "Drawing Jam" several years ago. It's one I had forgotten I had done and I was amazed to see it.

I'm not normally into portraiture, but I thought then and think now that this turned out pretty well. Of course, I can see a ton of little things that I know aren't right, but I still really like the overall effect.

January 17, 2007

Muscle Studies

I'm preparing to rig one of the models I have using a muscle/skinning plugin and cloth.

In getting ready for that, I've been doing some muscle studies.


Concentrating on the shoulder/upper arm area first; I'll be doing more over the next few days or a week.

Maya 8.5 with Python

Maya 8.5, now with Python!

I don't think I'm going out on a limb to state that one of the requirements of a platform is to be scriptable. I've never understood why platform creators (which is really what Maya is, a platform for doing 3D graphics) have felt the need to create their own scripting languages. There are a number of choices for embeddable languages: Python, Perl, and Tcl. I've always felt that Python was the number one choice. It has been embeddable since version 1.0 came out in early 1994.

Now I don't know how long MEL has been around, but it may predate the release of Python and I totally get not re-engineering something that's working, but I'm really jazzed about being able to use Python do do my scripting. It's awesome that Autodesk has done this work. If this is the type of thing we'll see coming out of Autodesk, I'll be really pleased.

Having built a reasonable sized system (RigBuilder which has around 15K of MEL code with the main driver being around 2K and another 12K-13K of rig modules), I know I needed better data structures than MEL provided several times. Using parallel arrays as an advanced data structure just doesn't cut it.

Now I just have to get my hands on it. Too bad the PLE is based on 7.0.

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.