Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions sourceRectAtTime Proximity Detection

  • sourceRectAtTime Proximity Detection

    Posted by Scott Mcgee on October 2, 2017 at 4:01 pm

    If I precomp layers, this works fine.

    R = thisLayer;
    L = thisComp.layer(index+1);
    delta = (R.width + L.width)/2;
    if (length(R.position, L.position) <= delta)
    0 else 100;

    But text and shape layers that aren’t precomped, when I check width, are the width of the comp. The problem is that it doesn’t work with the above expression.

    I’ve tried using sourceRectAtTime, but it doesn’t appear to be working, but at least, it doesn’t see the width as the width of the comp.

    R = thisLayer;
    L = thisComp.layer(index+1);
    delta = (R.width + L.sourceRectAtTime().width)/2;
    if (length(R.position, L.position) <= delta)
    0 else 100;

    Any suggestions.

    Scott Mcgee replied 8 years, 10 months ago 1 Member · 1 Reply
  • 1 Reply
  • Scott Mcgee

    October 3, 2017 at 8:29 am

    Solved my problem.. It was working fine, but it was the anchorPoint that was causing my problem.

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