PDA

View Full Version : Snake Rig


KDogHall
02-29-2008, 08:57 PM
I know there are many things out there about snake rigs but I'm creating a snake that will be standing up more than slithering on the ground, so I need a different type of control. Essential what I would like is to have an IK set up between the tail and the head so that i can move the head to a position easily, and then be able to change the shape of the snake with a splineIK type setup. All the tutorials I see say to use a splineIK set up but this does not have the benefit of the ease of a straight IK set up. Is there a way to create this sort of hybrid between a straight IK and spline IK?

Hopefully that is clear enough and much thanks goes to anyone who can help.

JasonStockton
02-29-2008, 11:53 PM
Try this (http://www.freewebs.com/jasonstockton/Snake%20Rig%20EXAMPLE.mb). I hope you are using Maya. I put this together real fast for you to show you it is possible, but the results may not be satisfactory. It was done with a 4 joint chain and so the bends are a bit harsh. I'm not too sure how it would turn out on a larger scale, but again it is only to show that a hybrid is possible. You would just need to make it cleaner :D I did not name anything so that you would know exactly what was being used. If it is what you are looking for and you could use more input just let me know.

KDogHall
03-01-2008, 09:30 PM
This is almost exactly what I'm looking for with the only difference being I obviously need more joints. My head is a bit fried right now though so I'm having trouble disecting how this was done. I understand the difference between the spline IK and regular IK and really like the way you demonstrated it (and also really appreciate all the work), but I'm having trouble figuring out how the "snake skinning bones" is put together. Thanks again so much, this is great.

JasonStockton
03-02-2008, 05:51 PM
Well, I'll try to be as specific as I can about how I went about it. Let me know if something doesn't make sense. Make the three joint chains, one for your bind, one for the IK, one for the Spline IK. I usually draw a prototype chain, shaping however I need to, and then redrawing my actual chains over the prototype while vert snapping the new joint over its associated prototype joint. This will give you three chains without rotations and unnecessary values on the joints, as well as orient them properly. In the example the chains are seperated, to distinguish them from each other easily. In my workflow however all three would be on top of each other, working with the outliner and hiding what I'm not working with when selections are needed. So let's get to it. Attach the IK handle to the IK Joint chain. Attach the Spline IK handle to the Spline IK joint chain. Grab the curve for the Spline IK and go into component mode (F8). Grab each point on the curve individually and make a cluster deformer for each(create deformers menu under animation). When that is done leave component mode (F8 again). Now make curves that will control the clusters. Doesn't matter the shape, I used circles. To do this make an empty group node, or a null. Vert snap it to a cluster (hold down V and drag it to the cluster). Once in place duplicate it. Normally I rename these to PAD and UTILITY, but without naming they will just be null1 and null2. Freeze the transforms. Place the null2 under the null1 and freeze the transforms on null2(child of parent). Vert snap a curve that you made to the same cluster, freeze transforms, and place it under null2, again freezing transforms. The nulls allow something to control the curves with the curves being able to maintain their own values. Parent contraint the cluster to the curve. Repeat the above for all of the clusters and then we move to the IK. Make your control curve for you IK. Place it wherever it will be and freeze transforms. Parent contraint the IK handle to the new control. The IK should be ready to go now. With that said the rest is a matter of parent constraining some more. So select a joint of your IK chain and then the parent null of the associated cluster in the Spline IK setup and parent contrain. This will cause the movement of the IK joint to control the Cluster movement of the Spline IK. Repeat for all of the IK joints and Spline IK clusters. Since the clusters don't always land exactly on a joint use your best judgement on what joints should control what clusters. If I made sense and things were done correctly the IK chain will control the Spline IK chain when you are finished, with the ability to manipulate the Spline IK independently without any of the clusters popping back into place when moving the IK chain. From there you just parent constrain the Skinning joint chain to the Spline IK (Spline IK as parent). Now the Skinning chain should move when you move the IK as well as the Spline. The trick to all of this is the parenting and padding. Again, with pads or nulls we can have the IK control the Spline IK without the clusters popping back. Direct parenting will cause them to pop back into place before moving with the parent which will not allow you to shape the snake with the Spline IK while controlling with the IK. The padding/parenting technique, or utility nodes as I have once heard them referred to as are a wonderful asset to a rigger, as they allow a lot of freedom when connecting anything together. At least I'm a fanatic about them :D So hopefully that got you through it. Again just let me know if something didn't make sense, or if it just didn't come out right and we will try again :thumbsup: . Good luck.

KDogHall
03-02-2008, 10:58 PM
I'm creating this now and being very deliberate and meticulous with actions so I don't mix up one thing and have to spend hours troubleshooting later. As of now I think I'm on the right track and its making sense, but only time and the finished product will tell. Thanks so much for your help.

JasonStockton
03-02-2008, 11:11 PM
NP :), good luck.

KDogHall
03-03-2008, 12:38 AM
The first problem I'm noticing is with this:

"So select a joint of your IK chain and then the parent null of the associated cluster in the Spline IK setup and parent contrain."

This is where an issue may pop-up regarding the example being with so few joints. My rig has about 40 joints to get smooth bends, but in order to be easy to animate I only have 10 clusters on the spline IK. Therefore do I parent all joints on the IK chain, or just the ones that have a cluster driving it?

JasonStockton
03-03-2008, 02:14 AM
I hope this (http://www.freewebs.com/jasonstockton/snakePic.gif) picture will help. The Spline IK clusters do not drive the regular IK chain, it is the other way around. The yellow text is the null1/null2/control curve hierarchy for the Spline IK clusters as it would appear in the outliner. In the picture the joint circled in yellow (IK) is what you would select first, the null1 pad second, and then parent constrain. The curve near the yellow text is the parent of the cluster within the curve (another parent contraint). The same process is just repeated down the chain. As far as every joint in the IK chain having a child (a padded cntrl curve setup in the Spline IK chain), no. Only the joints in the IK chain that, if the Spline IK were overlayed upon it, have cluster controls near them. The other joints are free to just be IK. The other colors show some cluster control pads can be controlled by either of two joints, if close to both. That is where a judgement call is needed on which way it will work best. On the example RIG setup provided every color was used, but it could have been done without the green and red and just used the yellow and white twice.

So as far as having more joints than clusters goes, such as your 40 joint/10 clusters, let us use all the colors and the black X's as the example. Each colored circle is a joint in the IK chain, the black X's near the bottom are the null1/null2/cntrlCrv padding setup that drives the clusters. Like your 40/10 we have more colors than X's. I drew arrows from the joints that I would use as my parents, again leaving green and red out. I understand if this doesn't clear things up, I do not necessarily know if I am presenting it in the best way for anyone. It would be so much easier to explain if you were here :shrug: Fortunately I'm not going anywhere so just keep in touch on how things are going.

KDogHall
03-03-2008, 07:10 PM
I got it working, and even more amazing is I understand it. The one issue I have now is that I want to create a root/master control so I can move the entire snake to its starting point in the scene, but am having trouble. Tried creating a master control curve and parenting all the control curves to it, and it all works fine except for the control that drives the head and IK handles. Any idea what I may have screwed up or am forgetting to do?

Dragwah
03-03-2008, 07:56 PM
Hey Jason,

The IK/Spline Hybrid is great! but I'm wondering if there is a way to make the curve created with the splineik a softbody with different weights on the particles so one can have dynamic motion along with the extra control of the ik setup and the spline controls? I'm trying it out, but I'm having a hard time figuring out what to parent to what to make it work. Parenting the second teir null groups to the particles and the dynamic curve to the ikHandle makes it freak out.
Do you know how to make a dynamic/ik or dynamic/fk work?

KDogHall
03-03-2008, 10:20 PM
I broke the rig by mistake which turned out to be a blessing in disguise because when I remade the connections I got the master ctrl to work. Thanks again for all you're help, best of luck in the future!

JasonStockton
03-04-2008, 01:52 AM
KDogHall - Awesome man, I'm glad you got it to work along with your master control :thumbsup:

Dragwah - Interesting idea. I can not say "I know how", but I will definately give it a try when I get a chance. Going to be busy this week. If you come up with something please let us know, again you have me interested. I'll keep my eye on this thread to see if anyone comes up with anything for your dynamic/IK or dynamic/FK challenge. BRING IT ON!!! And good luck.

CGTalk Moderation
03-04-2008, 01:52 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.