Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Mask path and linear expression

  • Mask path and linear expression

    Posted by Riccardo Schito on November 12, 2019 at 4:52 pm

    Hi all!
    I’m trying to do a simple setup so that every time I move a layer, a mask path animates.
    I know that the problem (at least for my newbieness) about mask path is that there’s no changeable value like any other properties, so I tried to use index key to set a linear expression.
    It doesn’t work because the error says “Path object found where a number array or property is needed”.

    This is not urgent , I can skip this things by simply animating mask keyframes, but I don’t know how to do that, and that drives me crazy.

    If anybody can help me, well… Thank you in advice!

    var A = thisComp.layer("layer").transform.position[0];
    linear (A,0,100,key(1),key(2))

    Dan Ebberts
    replied 3 weeks ago
    4 Members · 4 Replies
  • 4 Replies
  • Alex Printz

    November 12, 2019 at 5:48 pm

    try it like this:

    valueAtTime(linear(A,0,100,key(1).time,key(2).time))

    Alex Printz
    Mograph Designer

  • Riccardo Schito

    November 15, 2019 at 6:04 pm

    Mmh, no I’m sorry, it doesn’t work.
    I thought it was a issue with the inPoint of each layer, so I tried to add a var T= time – (thisComp.layer(“layer”).inPoint + inPoint) but then the expression becomes incorrect…

  • Florian Mondl

    January 27, 2025 at 2:18 pm

    Path interpolations can not be done like this. You need to place your keyframes at a fixed time interval (for example one second) and then apply the linear function to the mask path like this:

     

    var A = thisComp.layer(“layer”).transform.position[0];
    t = linear(A, 0, 100, 0, 1); valueAtTime(t+thisLayer.inPoint);

    
    
    		
        
  • Dan Ebberts

    January 27, 2025 at 8:20 pm

    I think this is what you’re after:

    a = thisComp.layer("layer").transform.position[0];
    t = linear(a,0,100,key(1).time,key(2).time);
    valueAtTime(t)

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