Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions sourceRectAtTime() of shape layer before trim path ?

  • sourceRectAtTime() of shape layer before trim path ?

    Posted by Anders Hattne on February 20, 2017 at 5:21 pm

    Hello!
    I am trying to automate drawing some shape layers with trim path – the time it takes for the line to be drawn should depend on the length of the line which I got with sourceRectAtTime()
    But I think my problem is that when trim path is at 0% sourceRectAtTime will give me a value of 0 and draw the line in no time
    Is there any way of getting the size of the layer before trim paths?

    layerS= thisLayer.sourceRectAtTime();
    h = layerS.height;
    w = layerS.width;
    len = length([0, 0], [w, h]);

    trans = linear(len, 200, 800, minTim, mxTim);
    a = linear(time, startTime, startTime + trans, 0, 100);

    http://www.ardillamedia.com

    Anders Hattne replied 9 years, 6 months ago 1 Member · 1 Reply
  • 1 Reply

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