Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions motion trail scale array question

  • motion trail scale array question

    Posted by Aaron Kent on August 28, 2011 at 10:29 pm

    so I have a little cursor and I’ve animated one layer. I duped the layer and added expressions to position and opacity from a tutorial I found online to create a motion trail. I’m trying to add an expression to scale to have the trail slowly taper:

    x = thisComp.layer(index-1).transform.scale-10;
    y = thisComp.layer(index-1).transform.scale-10;

    [x,y]

    howeve, After Effects keeps giving me this error

    After Effects warning: array piece can’t expand to more than one value
    Expression disabled.

    is it the index-1 thats confusing it?

    Thanks for any help in advance.

    AK

    x = thisComp.layer(index-1).transform.scale-10;
    y = thisComp.layer(index-1).transform.scale-10;

    [x,y]

    Pete Burges replied 14 years, 8 months ago 3 Members · 6 Replies
  • 6 Replies
  • Aaron Kent

    August 28, 2011 at 10:36 pm

    Got it to work. It was some kind of syntax thing. Here is the expression that works.

    x = thisComp.layer(index-1).transform.scale[0];

    [x-10,x-10]

  • Dan Ebberts

    August 29, 2011 at 12:00 am

    This should work too:

    thisComp.layer(index-1).transform.scale – [10,10];

    Dan

  • Aaron Kent

    August 29, 2011 at 12:12 am

    thanks Dan, that makes it a bit clear still.

    AK

  • Pete Burges

    September 1, 2011 at 2:20 am

    Hi guys,

    Please forgive the rank noob wading in out of his depth. I am working through Dan’s tutorials in an attempt to learn how to make my own expressions. I have the same setup as Aaron is describing, but I tried using your transform expressions on the scale and it gives me an error:

    Bad argument: Layer index 0 out of range.

    Both your expressions give me the same error- yet the index function works fine in other expressions I’m using. Does this have something to do with the fact I’m using After Effects 7? I’ve tried looking through the FAQ but can’t find an answer.

    thisComp.layer(index-1).transform.scale - [10,10];

  • Dan Ebberts

    September 1, 2011 at 2:42 am

    My guess is that you have applied the expression to Layer 1 (the top layer in the timeline panel) and it’s trying to find the previous layer (index = 0), which doesn’t exist.

    Dan

  • Pete Burges

    September 1, 2011 at 3:26 am

    D’oh! I assumed that as it copied layers above it would be referring below. Thanks for bothering with such a rookie mistake, Dan.

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