Monday, August 29, 2005

More Rig Features

I added some new features to my character rigging Max script over the weekend. First, I improved the stability/predictability of the IK solver on the arms by changing the method that I use to control the swivel angle. The new solution that I came up with is the best system I've created so far, and best of all, now that it's in my script I never have to set it up again. I can just push the button and it's done.

The second feature that I added is the ability to animate the arms with either FK or IK and switch back and forth between them easily in the middle of the animation. This is a feature that I've always wanted to have. Usually arms work best when animated with FK in my opinion, since they naturally move in arcs - but there are times when you really need to have an IK solution. I'm really happy to have this feature now so that I can use both. I haven't tried to create an animation with it yet - so it's always possible that the IK/FK solution that I came up with won't work correctly and I'll have to go back to the drawing board.

Speaking of going back to the drawing board, I came up with an auto clavicle system the day after my previous post and implemented it in a couple of the characters at work. I thought it was a good system and it did work really well - but only if the character had his arms out to the sides. As soon as the character put his arms in front, the clavicle bone "popped" when the wrist moved above the shoulder. Anyway, I'm still working on that one. More to come!

Saturday, August 20, 2005

Auto Clavicle - How?

I need some help creating the rig for a clavicle that works automatically. If anyone actually reads this blog that knows what I'm talking about, send me an email. I really want to know how to do it. More details below.

More progress on my character rigging script. I turned it into a macro script and added a control panel GUI. Now you can add the script as a button to a Max tool bar. When you hit the button it brings up the control panel which allows you to choose the settings that you want for the rig before creating it.

First you push a button that lays down all of the guide points. You position these points where you want the joints to go. It creates 6 points for the spine and 4 points for each of 4 fingers on each hand. If you want fewer joints than that, you can just delete the points that you don't use and the script will only create joints for the points that are there. Once you've got the points in position for one side of the body, you can hit another button to mirror the positions of the points on the other side. This is a nice time saving tool.

Before creating the rig, you can choose the colors that you want want for all of the various parts of the rig, give the rig a name (which gets prepended to all of the rig objects), choose options for adding additional twisty bones to aid in deformation on the arms and legs, etc.

Once you've got the settings the way you want, you just press the "Create All" button and you're rig is automatically generated. There are also buttons on the control panel to create all the various parts of the body individually if you want to do that.

So far, I've used the rigging script on two characters that I've rigged at work and it's amazing. I wish that I'd done this a long time ago. It saves so much time and I'm able to have a high quality rig for every character without having to build it from scratch every time.

Next I'm planning to add more options. I want to allow you to pick if you want IK arms, FK arms, or both, etc. I also want to add an auto clavicle system - hense the name of this blog entry. I want the clavicle joint to stay where it is unless you raise the arm control (at the wrist) higher than the shoulder. At that point I want the clavicle to rotate up instead of the shoulder - just like a real shoulder joint works. I want this to work automatically so the animator doesn't have to manually tell the clavicle when to rotate. If anyone out there knows how to do this, I'd love to hear from you. I'm planning to spend some time this week investigating the problem. If I come up with a good solution, I'll post it here.

Thursday, August 11, 2005

Rig Script Progress

I've made a ton of progress on my character rigging script. It's been really fun learning to use MaxScript. I'm getting better at it - although some things are still quite challenging. I think that the hardest thing so far has been learning the syntax for wiring parameters. For some reason, parameter wiring uses a different syntax than when you're doing others things with parameters. It doesn't make much sense to me - but I'm just new at it. I'm really greatful to the people on CgTalk and the Discreet support forums that have helped me with the wiring syntax.

My script makes arms, hands, legs, hips, and spine and links them all together for a complete character. It allows you to have anywhere from 1 to 6 spine joints. Hands are optional. If you add hands, you can have between 1 and 4 fingers and an optional thumb. Each finger can have between 1 and 3 joints. I've built a lot of flexibility into it so that it can be used for characters that need to be really light weight (not very many bones) and also for characters that have a full set. You can even choose to add extra bones in the arms and legs to aid in skin deformation if you need them.

The best part is that everything is wired, rigged, constrained, etc, and ready to animate. I even added a bit of code at the end that creates selection sets for the different types of objects (bones, controllers, etc) and hides the objects that you don't need to work with.

All I have left to do is the neck and head (which shouldn't be too hard) and a bit of clean-up and polish. Maybe I'll make a nice GUI panel for the whole thing too so you can choose the options that you want. Once I've got the whole thing done, I'm planning to do some more research into other types of rigs and posibly create some more options for the script. For example, I could let the user choose between several different types of spine setups, etc.

I'm really excited about how much rigging time this is going to save me at work. All of my character rigs will be able to use the great features I've built into this script and all it will take is one button press!