Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Expression for a sting/chain hanging between two points

  • Expression for a sting/chain hanging between two points

    Posted by Matthew Woods on January 15, 2008 at 9:21 pm

    Ok, here is a tricky expression problem for people.

    I am trying to create a chain that hangs between two points that independently move. To do this I am using an image of straight piece of chain with the puppet tool and 3 pins, one in the center, and one at either end of the chain. I marry the two end pins to my two moving points, with an expression, and I at first tried to hand animate the center pin, but it is very hard to get it to move convincingly.

    For this purpose, I don’t care about momentum or drag. What I need is an expression for the center pin that takes the positions of the two end pins, and some gravitational constant, and computes the position of the center pin that hangs down between the other two.

    Any ideas?

    Thanks,

    -Matt

    Fritz Gnad replied 18 years, 3 months ago 2 Members · 1 Reply
  • 1 Reply
  • Fritz Gnad

    February 7, 2008 at 3:56 pm

    Hi Matt,
    I am not to shure about the gravity, but the basic expression setup should be like this:

    Apply the puppet tool to your layer, setup the three points as you mentioned. Create two null-objects, “null01” and “null02”. Connect the outer point of the puppet tool via an expression to the position of the corresponding null object. for the middle point use this expression:

    x1 = thisComp.layer(“null02”).transform.position[0];
    x2 = thisComp.layer(“null01”).transform.position[0];
    y1 = thisComp.layer(“null02”).transform.position[1];
    y2 = thisComp.layer(“null01”).transform.position[1];
    [x1+x2/2,y1+y2/2]

    I think you’ll have to add some offset to the x-value (-50? -250?) inside the fomula, but i am not quite shure how to do the gravity…

    I hope I could help you a little bit!

    Fritz Gnad * Video Artist & Motion Graphics * http://www.feezenfreezen.de * Barcelona, Spain

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy