Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions connect 2 nulls with line using inPoint

  • connect 2 nulls with line using inPoint

    Posted by Peter Zeet on January 20, 2016 at 1:02 am

    Hi!
    I connected 2 nulls with a line (shape layer), and I have to repeat that line a looot of times.
    The nulls are moving at irregular intervals at the first frames of the timeline, so I want the bunch of lines follow these animations starting with their inPoint… I have it working with the position, but I have some issues making the rotation working with the valueAtTime…
    any ideas?
    this is what I was trying for the rotation, but the offsetting is not working properly
    t = time-inPoint;
    L = thisComp.layer("up")
    J=thisComp.layer("bottom")
    a=L.transform.position.valueAtTime(L.inPoint+t);
    b=J.transform.position.valueAtTime(J.inPoint+t);
    r=Math.atan2(b[1]-a[1],b[0]-a[0]);
    radiansToDegrees(r);

    thanks!

    Peter Zeet replied 10 years, 6 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    January 20, 2016 at 1:37 am

    Are the in points different for each layer? If so, I’m not sure how this is going to work. Don’t you need the rotation to match where the nulls are at the current time?

    Dan

  • Peter Zeet

    January 20, 2016 at 2:06 am

    mmm I should have explained better:
    the scene is something like an assembly line, and the animated shape layer would be a chain (with a product at the bottom). So the basic animation is the null at the top going from left to right of the screen, with some holds in the middle of the screen. The bottom null would drive the overlaping animation of that chain when the Up null makes the hold.(And going down to find a paint bucket and then up again) Then the animation continues to the right.
    So this is repeated like 50 times. The way the scene is done I can’t precompose anything (plus the client needs the scene this way), so I was faking it with the inPoint thing, so I just make the sequence once on each null.
    Maybe there is a workaround to drive the bottom of the chain triggered by each shape layer’s inPoint?

    (this is one of these cases where I could have it done by hand and finished it time ago instead of trying to speed the proccess via expressions, but now I can’t stop until I figure out how to do it via expressions! arg

    anyway, if you think it’s a waste of resources, I’ll have to do it by hand

    thanks again!

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