View Full Version : Making a chain that's tethered on two ends
FloydBishop 07-21-2003, 06:04 PM Think of a small length of chain that's on a pair of handcuffs.
What's the best (read "easiest") way to pull this off in Maya 4.5?
I've got the "CreateChain" script from High end, and that works out ok, but I can't seem to get both ends of the chain to animate. I'd rather not use real dynamics, if possible.
I'm in a rush to get this seemingly simple bit of business out the door, so any help is greatly appreciated.
I've done a search on the forum here and I haven't found anything that helps me out.
|
|
jHromika
07-21-2003, 09:14 PM
I'm not familiar with the chain script, but I'm going to guess it creates a chain link based on the users parameters and nothing more?
Depending on how much animation you need, you might want to try rigid binding each link to a seperate joint, then set up an IK spline and animate clusters.
Well, that's probably how I'd end up doing it since thats all that comes to mind at the time :hmm:
Good luck
FloydBishop
07-21-2003, 09:26 PM
Can you walk me through it just a bit more? I'm a rigging novice to say the least. I know what an IK spline is, but not how to create one.
Also, how to implement the idea of having them tethered on both ends, and some bit dangling between them is a bit vague.
You can find the "Create Chain" MEL script here:
http://www.highend3d.com/maya/mel/?group=melscripts§ion=animation
jHromika
07-21-2003, 09:35 PM
do you have a couple hours, or does it need done really asap? I'm at work now, but leaving soon. I can probably do a better write up at home, but if you need it now I'll hang out here to do it.
FloydBishop
07-21-2003, 09:49 PM
I'll go ahead with the animation I need to do, and then add the cuffs on later.
Thanks for the help, and I'll check back later on!!
kmp3d
07-21-2003, 10:20 PM
I think I may know where jHromika is going with his explanation. After your create your links, create one joint for each link in the chain and then rigid bind each link to each corresponding joint. Now add the spline IK. A curve will be created following your joint chain. Each CV of the curve is a control point, you can delete CVs if you think you have to many on your curve. Then create clusters out of each CV or groups of CVS depending on how you want your control to be. Then you can animate your clusters to get the chain motion you want. I know you said you didn't really want to use dynamics but, another thing you may want to try is to make the spine IK's curve a softbody with goal then you can weight each particle. Weight the particles using the component editor. Weight the particles closest to the cuffs with a weight of 1 and the weight the particles closer to the center of chain with a lower weight. With a little bit of tweaking and gravity you can get really good realistic chain motion.
jHromika
07-22-2003, 12:25 AM
Ok, I've built the handcuff setup, and it works kind of well I suppose. I think kmp3d is right on with the softbodies, but I don't have any experience with them, so I can't help there. I also tried the script and couldn't get it to work (sometimes I'm quite the fool with MEL ;) ) so I just built a quick and dirty pair of cuffs.
So, say your cuffs look like this...
FloydBishop
07-22-2003, 12:30 AM
Yes, they look like that.
jHromika
07-22-2003, 12:37 AM
I started out by drawing a series of joints. I've got 2 cuffs and 9 links, so I made chain of 12 joints (since I couldn't bind the second cuff to the last joint, I had to add another to the chain. Heh, learn something new everyday :D )
[edit ~ bah, just realized I forgot to add to grid snap the first cuff joint, then hold shift to draw the rest of the chain in a straight line.]
http://www.hromikarenders.com/images/cuffs_bPIC.jpg
Just cause I'm a stickler about naming nodes, I'm gonna go through the renaming process as well.
joint1 --> cuff_aJNT
joint2 --> link_aJNT
joint3 --> link_bJNT
joint4 --> link_cJNT
joint5 --> link_dJNT
joint6 --> link_eJNT
joint7 --> link_fJNT
joint8 --> link_gJNT
joint9 --> link_hJNT
joint10--> link_iJNT
joint11--> cuff_bJNT
joint12--> endJNT
Now we'll draw the curve for the IK Spline. Use the CV Curve tool with curve degree set to linear.
Using v-snap, place CV's in this order:
cuff_aJNT
link_bJNT
link_dJNT
link_fJNT
link_hJNT
cuff_bJNT
http://www.hromikarenders.com/images/cuffs_cPIC.jpg
Rename the curve to "cuffsCRV"
jHromika
07-22-2003, 12:50 AM
Then, create an IK Spline with these settings
http://www.hromikarenders.com/images/cuffs_fPIC.jpg
Select "cuff_aJNT", "cuff_bJNT", "cuffsCRV"
Rename the IK handle "cuffsIK"
Hide everything except the curve, and go into CV edit mode.
Create clusters on the 4 inside CV's (make sure relative is on)
Rename these clusters:
cluster1 --> "link_aCLS"
cluster2 --> "link_bCLS"
cluster3 --> "link_cCLS"
cluster4 --> "link_dCLS"
To keep the clusters out of the controller heirarchy we'll point constrain them to null nodes, and parent those nulls under the control nodes.
With nothing selected hit Ctrl+g.
Rename this null "link_aClsRIG"
Duplicate the null node 3 more times and name them:
"link_bClsRIG"
"link_cClsRIG"
"link_dClsRIG"
V-snap each null node to its respective cluster.
Freeze Transformations on the 4 nulls.
Now point constrain them to the clusters.
Select "link_aClsRIG" then "link_aCLS" Constrain > Point.
Repeat for the 3 remaining clusters.
jHromika
07-22-2003, 12:57 AM
Create your 4 controllers (I prefer cube shaped curves. Here's a script to make a quick one if you want)
--------------------------------------------------------
curve -d 1 -p -1 0 -1 -p 0 0 -1 -p 0 0 0 -p -1 0 0 -p -1 0 -1 -p -1 1 -1 -p 0 1 -1 -p 0 0 -1 -p 0 0 0 -p 0 1 0 -p 0 1 -1 -p -1 1 -1 -p -1 1 0 -p -1 0 0 -p 0 0 0 -p 0 1 0 -p -1 1 0 -k 0 -k 1 -k 2 -k 3 -k 4 -k 5 -k 6 -k 7 -k 8 -k 9 -k 10 -k 11 -k 12 -k 13 -k 14 -k 15 -k 16 ;
---------------------------------------------------------
Name the 4 controllers:
link_aCTRL
link_bCTRL
link_cCTRL
link_dCTRL
V-snap each controller to its respective cluster.
[Edit ~ You may have to resize the controllers (if you used my script). Just make you you adjust size / shape in component mode.]
Freeze transformations to the control nodes.
Parent the "RIG" node under the "CTRL" node for each set.
Now all thats left is to rigid bind the links to the joints.
Cuff_aGEO --> cuff_aJNT
link_aGEO --> link_aJNT
link_bGEO --> link_bJNT
etc...
That should be it. Here's a pic of my final outliner, and just one with the links posed.
http://www.hromikarenders.com/images/cuffs_ePIC.jpg
http://www.hromikarenders.com/images/cuffs_dPIC.jpg
Depending on how much more or less control you need, you could add more or less CV's on "cuffsCRV" and hence more or less clusters to control. Like I said, it works kind of well, well enough I hope for what you need. If not, maybe try softbodies out, but I can't really help you there I'm afraid.
Hope this helps :)
jHromika
07-22-2003, 01:02 AM
Here's a link to my file (http://www.hromikarenders.com/cuffs.mb) in case you want to play around with it, or take a closer look since it was kind of a rushed explanation.
FloydBishop
07-22-2003, 01:25 AM
Thanks so much for the walk through, but it still doesn't seem to solve the problem of what happens when the prisoner moves his hands in the cuffs.
For example, He lifts his right arm, and that side of the cuffs goes up.
He lifts the left side, and that side goes up.
I'm trying to do something like the attached file, which I based on this tutorial:
http://www.boris3d.de/t_rope.html
FloydBishop
07-22-2003, 01:26 AM
The question now is: is there an easier set-up that does something like what I've attached?
jHromika
07-22-2003, 01:40 AM
That file definately looks like it would animate a lot smoother and easier. I thought about that point (moving the wrists) shortly after linking my file, so I went back to it.
You could repeat the process of the clusters / controllers on the last 2 CV's which would set up 2 more controllers for the cuffs. You could then contrain those to your characters wrists.
The IK setup compared with using springs and gravity is gonna be a lot more work to animate though, so I'd probably stick with what you're doing. In both cases it looks like you'll need to keyframe each cluster if the wrists move too much though.
FloydBishop
07-22-2003, 01:45 AM
I only need it for a few shots, and now it looks like the client wants the prisoner's hands to be cuffed behind his back!
Problem solved!! (after a day of trying to figure it out)
jHromika
07-22-2003, 01:50 AM
lol!
I'm not sure whether to give you a :beer: or a :banghead:
*grin* nah, thats great. Problem solved and we both learned something. I'd say that earns a drink :D
FloydBishop
07-22-2003, 02:55 AM
Actually, they just switched it back.
I think I'll use the dynamics solution. We'll see how it goes.
At any rate, thanks for the help.
jHromika
07-22-2003, 04:12 AM
doh! Just when you thought you were out of the woods...
But yeah, I'd go dynamics too personally. The end result oughta be much nicer.
Always glad to help :)
jHromika
09-25-2003, 07:08 PM
Hate to bump an old thread, but sitting here in dyamics class, we just started covering rigid bodies and constraints. The example he chose to show us was handcuffs...
It's so simple and looks great! And to think I told you to spline IK it.... :rolleyes:
- Create your chain links, and with those, create a low-res version to speed up the calculation process.
- Select all of the low-res links and create a gravity field, thereby making the links active rigid bodies.
- Select one end link (low-res) and create a nail constraint. (Soft/Rigid Bodies > Create Constraint > Option box)
- Repeat for the other end link.
- Point constrain the rigidNailConstraints to their respective cuffs.
- Parent the hi-res links under the low-res links.
- Hide the low-res links.
Play through the animation. The links will react to themselves, while being pulled along by the cuffs due to the nail constraint.
Now, he didn't show us anything about keyframing the "cuffs" part, nor have I set it up in that manner, but I imagine this would be how it would work.
I know it's not going to do you any good at this point for that project, but it's still something I'd like to know if the roles were reversed.
FloydBishop
09-25-2003, 07:10 PM
Originally posted by jHromika
Hate to bump an old thread, but sitting here in dyamics class, we just started covering rigid bodies and constraints. The example he chose to show us was handcuffs...
That project is dead and buried, but I think a lot of people here would benifit from a sample file.
How about posting a quick mock-up?
jHromika
09-25-2003, 07:12 PM
sure, I'll whip one together, and that was kinda scary how quickly you replied :D
FloydBishop
09-25-2003, 07:25 PM
Originally posted by jHromika
sure, I'll whip one together, and that was kinda scary how quickly you replied :D
I'm ALWAYS WATCHING!!!
plus I'm subscribed to this thread ;)
jHromika
09-25-2003, 08:01 PM
But I mean, I barely had time to refresh the page and you were there!! :eek:
Hahah, anyway, here's the cuffs example file (http://www.hromikarenders.com/cuffsEx.mb)
I set a couple key frames on the cuffs to show the nifty dynamics involved, but the process was basically what I listed before. Although I did change the bounciness from 0.6 to 0.3 on the rigidbodies, which may or may not be correct, but 0.6 was just a *tad* high I think :D
I ended up placing the pivot point of the cuffs on the pivot of the end links before applying the nail constraint, and then I hid the end links. Without that I think it might be possible for the links to appear detached from the cuffs at some point, but since I'm just learning this, don't quote me *grin*
Well, enjoy!! If you have questions, I might be able to answer them, but either way I'll give it a shot.
FloydBishop
09-29-2003, 10:17 PM
You wouldn't happen to have a Maya 4.5 version of the file, would you? I can't seem to open the file you posted with 4.5.
jHromika
09-30-2003, 01:24 AM
Err no, sorry. The classes run 5.0 :hmm:
FloydBishop
09-30-2003, 01:36 AM
Originally posted by jHromika
Err no, sorry. The classes run 5.0 :hmm:
I think you can save in a 4.5 format... yes? If not, can you post an ASCII version of the file and I'll disect it on my end so it will open with 4.5?
verbal007
09-30-2003, 03:05 AM
Here's a good way to do it, especially if you're working on a dual proc machine.
http://www.systemshutdown.com/cgtalk/Chain_Dynamics.jpg
The links of the same color are calculated using collisions. The Differect colored links are attached via a hinge constraint. This works well, and if you have a dual proc machine, it will split the work up nicely, giving you better realtime feedback.
I've attached the scenefile as well.
- Jeremy
jHromika
09-30-2003, 06:40 PM
Here ya go, saved it as an ASCII because if there is a way to save as 4.5 I couldn't seem to find it.
Also, when I downloaded the above version, for some reason the one link wasn't reacting to the others as a rigid body, so I went and fixed that.
FloydBishop
09-30-2003, 07:07 PM
Originally posted by jHromika
Here ya go, saved it as an ASCII because if there is a way to save as 4.5 I couldn't seem to find it.
I thought there might be a retro save function... guess not. I edited the ASCII file though and got it to open in 4.5.
It works really well.
Kabab
10-01-2003, 01:19 AM
Here is another approach.
Use cloth !
Create a piece of cloth that goes between your cuffs and transform ? constraint eacn end to each cuff.
Then use the button constraint to attach your links to the cloth then hide the cloth.
Simple low res cloth calculates very fast and you get nice swinging motion.
CGTalk Moderation
01-15-2006, 04:00 PM
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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.