Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Range selector not working with sourceRectAtTime()

  • Range selector not working with sourceRectAtTime()

    Posted by Kawin Tisase on March 10, 2019 at 9:05 am

    Hello again, looks like I’m having new questions/problem for you guys -.-.
    My composition is HDTV 1920*1080 29.97 8bpc

    This is my text layer name “Multiple choice questions” . The layer in point is around 8 sec in the main composition.

    It has animator for scale name scaley .

    Another layer is shape layer 10, which is set to follow the “Multiple choice questions” by width and height of the text layer, by script in size and position. The layer in point is around 8 sec in the main composition.

    This is for size of shape layer 10.

    T=thisComp.layer("Multiple choice questions");
    w=T.sourceRectAtTime(time-T.inPoint,true).width;
    h=T.sourceRectAtTime(time-T.inPoint,true).height;
    [w,h];

    This is for position of shape layer 10.

    T=thisComp.layer("Multiple choice questions")
    w=T.sourceRectAtTime(time-T.inPoint,true).width/2;
    h=T.sourceRectAtTime(time-T.inPoint,true).height/2;
    l=T.sourceRectAtTime().left;
    t=T.sourceRectAtTime().top;
    [w+l,h+t] ;

    The expression works fine when I move the “End” parameter of range selector without keyframing it.

    But when keyframing it looks like the expression doesn’t work.

    How can I fixed this problem, I tired searching through internet and I found one person says they got it right by create new text and using same expression. I tired, It doesn’t work, plss help T-T.

    Note .
    The tutorial i use come from two sources
    https://www.youtube.com/watch?v=CVliDoNgoCg
    https://www.youtube.com/watch?v=kI3yzx6CATg

    Some contents or functionalities here are not available due to your cookie preferences!

    This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.

    Oleg Pirogov replied 7 years, 4 months ago 2 Members · 2 Replies
  • 2 Replies
  • Oleg Pirogov

    March 10, 2019 at 10:16 am

    What are shape’s Size and Position values when it disappears?

  • Oleg Pirogov

    March 10, 2019 at 11:06 am

    Oh wait.
    T.sourceRectAtTime(time-T.inPoint,true) – you evaluate sourceRectAtTime at time-T.inPoint.
    So at 9;22 it takes the size of the text’s rectangle at 9;22-7;28=1;24 which is zero, I suppose;

    Change it to T.sourceRectAtTime(time,true) everywhere, that should work.

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