Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions parent puppet tool “rotation” real problem

  • parent puppet tool “rotation” real problem

    Posted by Juan Banchero on September 11, 2010 at 4:27 am

    Ok my problem is not so simple. I need to link the rotation of a layer to be perpendicular to the relative position of 2 puppet tool pins. So when I change the position of the pin this rotate.
    something like this:

    I need to parent the position to, but I know how to do it by “toWorld”.

    This is because the layer can’t be afected for the puppet tool deformation.

    So any ideas?

    Chris Wright replied 12 years, 5 months ago 4 Members · 13 Replies
  • 13 Replies
  • Dan Ebberts

    September 12, 2010 at 5:06 am

    I’m not sure there’s enough information available to do that. You can get the world position of the pins, but I don’t know how you could derive the necessary angle from that.

    Dan

  • Chris Wright

    September 12, 2010 at 8:47 am

    I don’t fully understand the question, but Dan, can’t you use this expression from particular to turn the x,y toworld data into rotation data? something like this…

    v=effect(“Particular”)(“Position XY”).velocity;
    radiansToDegrees(Math.atan2(v[1],v[0]))

    https://technicolorsoftware.hostzi.com/

  • Dan Ebberts

    September 12, 2010 at 5:15 pm

    That example is using a velocity vector, which has a direction associated with it, which means you can calculate the angle. A point doesn’t have direction. I think you’d have to have the math that AE uses to calculate the bend. Then based on the positions of the three pins you could calculate the direction of the bend at the end pin and then calculate the perpendicular to that.

    Dan

  • Chris Wright

    September 12, 2010 at 5:30 pm

    sure, but couldn’t you get direction data by comparing the previous position data keyframe to get a direction? that’s pretty basic. I’ll see with what I can come up with.

    https://technicolorsoftware.hostzi.com/

  • Dan Ebberts

    September 12, 2010 at 5:40 pm

    Maybe I don’t understand what you’re after. I thought you wanted to keep the other layer perpendicular to the end of the bent layer. If so, I don’t think the directional vector (velocity) of a keyframed pin helps. You could get close by using the direction from the center pin to the end pin, but it won’t be very accurate because of the bend.

    Dan

  • Chris Wright

    September 12, 2010 at 7:16 pm

    here ya go Dan…

    A fully rotating, positional box always lined up perpendicular with a stretching, bending rectangle. It has 3 querks:

    1. it needs at least 3 keyframes. 2 isn’t enough to extrapolate an angle.
    2. it needs a one frame pre-roll and post roll to compute.
    3. There can’t be any sharp changes in the keyframe graph view.

    It’s an ae cs3 aep

    I’ve named it impossible.aep lol
    https://www.megaupload.com/?d=DLYKOKIP

    v=thisComp.layer(“Blue Solid 1”).effect(“Puppet”).arap.mesh(“Mesh 1”).deform(“Puppet Pin 1”).position.velocity;
    radiansToDegrees(Math.atan2(v[1],v[0]))

    and pickwhip the positions

    https://technicolorsoftware.hostzi.com/

  • Juan Banchero

    September 12, 2010 at 7:40 pm

    That is exactly what I want. thanks Dan. but I just dont know how to get it.

    To do it more simple. I could parent the pins to nulls and parent the object to my last pin’s null. But again How can I make the layer orient itself to look to middle pin’s null?

    by the way. the impossible.aep is nice but is not what I need right now. anyway thank for your interest and support Chris.

  • Chris Wright

    September 13, 2010 at 3:54 am

    my project doesn’t work when your not using circular motion. so why can’t you keep it simple, precompose the arrow with the bar and use starch at 100%, so it won’t bend there and put the pin on the arrow instead???

    https://technicolorsoftware.hostzi.com/

  • Juan Banchero

    September 13, 2010 at 3:22 pm

    yes I understand you and is a practical idea but can´t use that because is not a box, that was just a quick example.

    The real comp is a character arm and the box is the cuff of a shirt. But it cuold be a bracelet or anything else like that.

    So, what I need is parent the “cuff” layer to the wristNull and make it “look” to the elbowNull.

    Something similar like orient a 3D layer to a camera. No matter where you point the wrist or elbow, the cuff of the shirt always must looks to the elbowNull.

    I think I’m more clear now. And again, thanks for you sopport Chris.

  • Chris Wright

    September 13, 2010 at 9:11 pm

    ok i think this fixes it, it’s about 90% perfect, so add a slider to the layer to edit rotation.

    name your puppet pinned rectangle “End 2” and paste this in rotation of the arrow.

    Now you can use a dummy system so that you can parent objects, and the code will ignore the puppet pins and always auto orient to the layer being called to.

    follow2 = “End 2”
    diff = sub(position,this_comp.layer(follow2).position);

    (Math.atan2(diff[1],diff[0]) * 180/Math.PI) + 180+effect(“Slider Control”)(“Slider”)

    https://technicolorsoftware.hostzi.com/

Page 1 of 2

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