Animating a chain and padlock

   7967   13   3
User Avatar
Member
11 posts
Joined: July 2005
Offline
HELLO,
im trying to animate a chain and padlock that are holding a gate together. in the sequence, i want to be able to move the lock and have the individual chain links move realistically according to the movement of the lock.
do i use a bone structure for this? can i add gravity to the links to do this?
PLEASE HELP
User Avatar
Staff
3455 posts
Joined: July 2005
Offline
you could try using rigid body stuff - or you can wait a year for DOPs..

you can also try bones…use bones on curve/follow curveIK…it will take effort to get it to lokk realistic though…
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
2199 posts
Joined: July 2005
Online
Way back there was a demo file that did this with the spring sop (does that even still exist?)
The basics were to animate a line using the spring sop set with fairly rigid constaints and then copy cahin links to the animated line.

Maybe someone else can remember where to find the demo file….
The trick is finding just the right hammer for every screw
User Avatar
Member
412 posts
Joined: July 2005
Offline
Way back there was a demo file that did this with the spring sop (does that even still exist?)

the demo file or the spring sop? i dunno about the demo file but the spring sop is defininetly still there..

Maybe someone else can remember where to find the demo file….

couldn't help you out on finding it so i went ahead and created an example:

http://www.nocturnal-illusions.com/houdini/chainlinks.hipnc [nocturnal-illusions.com]

hth,
dave
Dave Quirus
User Avatar
Member
11 posts
Joined: July 2005
Offline
Wow guys, thank you so much! This really helps. I still have a few questions though:

1. with the spring sop, is there a way to make the source geometry seem harder, and not break up into a jelly-like mess when it hits the collision object? I tried messing with a lot of the parameters and none seemed to add “hardness” (for lack of a better word) to the source geometry.

2. I wanted to have a few differently-shaped links making up the chain. I tried using the copy sop's stamp feature to do this, but couldn't figure out what expression or data to put into the “var” and “param” fields to have these appear along the chain's curve template.

I found one good tutorial(http://www.grahamdclark.com/Studentresources/tutorials/copyOP/) [grahamdclark.com] for the copy sop but he uses the switch sop to animate between objects and I don't need the links in place constantly. Any advice would be very much appreciated!!

cheers!
User Avatar
Member
11 posts
Joined: July 2005
Offline
OHMYGOD! I just opened the chain HIP. Looks & works AMAZINGLY!!! Thanks so much Dave, you made my day!

-George
User Avatar
Member
412 posts
Joined: July 2005
Offline
glad it worked out for you..

it's not a perfect solution by any means. it can definitely get broken if you push it too hard or too fast, so be careful with that.

and there is no constraining on the strectching.. so you pull the first or last point apart too much and the links will seperate and intersect. might want to see if you can take what's there and work from it to get a better solution (one without stretching preferebly).

either way, hope it helps you out and it'd be nice to post your work when you've finished so we can all see how it turned out.

dave
Dave Quirus
User Avatar
Member
412 posts
Joined: July 2005
Offline
1. with the spring sop, is there a way to make the source geometry seem harder, and not break up into a jelly-like mess when it hits the collision object? I tried messing with a lot of the parameters and none seemed to add “hardness” (for lack of a better word) to the source geometry.

i'm thinking you're wanting to deal with the tension here. maybe some of the mass as well. also everything depends on what you choose as your fixed points.

2. I wanted to have a few differently-shaped links making up the chain. I tried using the copy sop's stamp feature to do this, but couldn't figure out what expression or data to put into the “var” and “param” fields to have these appear along the chain's curve template.

copy sop with stamping along with a switch sop is the best way to do something like this:

http://www.nocturnal-illusions.com/houdini/switchstampingrandom.hipnc [nocturnal-illusions.com]

hth,
dave
Dave Quirus
User Avatar
Member
11 posts
Joined: July 2005
Offline
Thanks so much again, Dave. I'm becomeing a Houdini master with every example. Thanks to you, I think I can figure the rest out from here. I've learned quite a bit from these examples.

The only thing I'd like to understand better is what the expressions are actually doing. In the first example, what is going on in the point sop with the expression you put into the “normals” field “$TX-$TX2.” It would be helpful for me to understand what this expression means. It feels wrong just typing that stuff in without having a basic understanding. Is there an expressions resource guide you or anyone might know of for Houdini 6 & 7?

Anyway, thanks so much! My chain link is starting to look great.

-George
User Avatar
Member
212 posts
Joined: July 2005
Offline
i haven't looked at the file but basically what the pointSOP is doing is computing a new normal direction. for you example for the $NX component based on the current value of $TX minus the second input's value for $TX, that's where the $TX2 comes in. So when you see $TX it means the ‘x’ component for all the points in the current geometry.

Try this as well to help.
Put down two grids with the same default settings. Append a facetSOP and toggle on the compute normals option for both. For one of the chains append a transformSOP and move the the grid up and over 1.5 units in x

Now append a pointSOP off the other chain. input the transformSOP into the second input of that pointSOP. Try the following:
T(urn on the display of normals first)
in the normal field where it says $NX put $TX2-$TX
You will see the normals of the 0,0,0 grid aim at the transformed grid.

I'm sure there are better ways to see this stuff, and more people here have different examples but that's mine without houdini infront of me

-k
User Avatar
Member
412 posts
Joined: July 2005
Offline
the kenny is right.. when copying the chain links to the curve with the spring solver on it, I needed each link to rotate to be in line with the direction of the curve. since the copy sop uses the normal and up vector of each point to align the geometry to be copied, i just changed the normals to do that.

so a common solution for that is to have your curve with points 0 - 99 or whatever. append a sort sop and have the numbers shifted by one. now the curve has points 1 - 100 instead. append a point sop to the original curve and connect the sort sop to the second input of point sop. As the kenny explained, I just told the normals to look at the next point on the line by using $TX (from the original curve) - $TX2 (from the shifted point number curve)..


if you have any other questions about the expressions used, just post them and someone will get you the answer. no worries..

as far as the expression guide, there is the expression pdf along with all the other pdf's in houdini 6.*.. for some reason they are gone in H7. have no idea why though..

hth,
dave
Dave Quirus
User Avatar
Member
11 posts
Joined: July 2005
Offline
Just saved the pdf from Houdini 6 onto my desktop for reference. It may be a while, but I'll get the hang of it.


Thanks again everyone!
User Avatar
Member
11 posts
Joined: July 2005
Offline
Don't want to push my luck here, but I was just trying to rig together these chain links to get them to move a certain way for this close up shot I want to do. The spring sop is AMAZING, i can't believe how smooth the movement is once you set the point sop up after it correctly. The copy sop is also probably one of the most useful sops I've come to understand thus far.

Problem is, now I'm having a hard time getting it so that I can animate individual points (copied link geometry) on the template curve and have the other links in the chain (or going into the switch sop) follow to create a sort of “domino” motion effect. You know, like if you imagine there's a chain on a table and you pick it up by one link. The other links follow and change orientation according to each preceding link. They are parented in that way. Do I have to forego the spring sop to do this? Is there any other way to rig it so that the other links follow the lead moving link? Bones kind of have the sort of movement I wanted, just playing with the follow curve feature, but I couldn't figure out how to parent geometry so that it won't be deformed by the bone movements. Maybe there's another, better way to do this.

Any advice would be really great.

Best,

George.
User Avatar
Member
2199 posts
Joined: July 2005
Online
jaialai
I couldn't figure out how to parent geometry so that it won't be deformed by the bone movements. Maybe there's another, better way to do this.


Don't try and capture and deform the geometry like you would normally do with a bone rig. Just parent a chain link to each bone and they should follow right along with the bones. Bones don't scale they only translate and rotate so there shouldn't be any deformation going on. You could also just go into each bone and change the geometry for each bone to your chain link geometry, this would avoid the need to parent anything.
The trick is finding just the right hammer for every screw
  • Quick Links