FORUMS: list search recent posts

Expression not allowing me to substitute a layer name for a layer pop-up variable

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Paul Roper
Expression not allowing me to substitute a layer name for a layer pop-up variable
on Sep 12, 2016 at 9:17:17 am

Hello,
I have been given a project to work on which contains a comp using the Easy Arrows script (http://aescripts.com/easy-arrows/). One of the expressions references another layer directly. The cromulent line is this:
mask = thisComp.layer("Path 1 Expression - Do Not Edit 1")("ADBE Transform Group")("ADBE Position").valueAtTime(newTime);
...but I want to duplicate the arrows, so need to tell each separate arrow to reference a different layer, so I added a layer expression control, and added the follwing to the expression (and set the Layer pop-up to that same "Path 1 Expression - Do Not Edit 1" layer):
pathLayer=effect("PathLayer")("Layer");
...
mask = thisComp.layer(pathLayer)("ADBE Transform Group")("ADBE Position").valueAtTime(newTime);

But I get an error.

Surely these two methods amount to the same thing? I've tried adding .value to the end of the pathLayer variable definition line, but it made no difference. Any suggestions as to what's going on would be greatly appreciated! For speed's sake, for now I'll probably just pre-comp each group of arrow layers and edit those, but I don't like having this unsolved problem!

(I know the "correct" answer to this problem should be "buy the script from Aescripts!" but I only intend to ever use it to fix this one and only comp).

Here's the complete expression, WITH my additions:
pathLayer=effect("PathLayer")("Layer");
totalDistance = 779.74613409518;
beginAddedDistance = 0;
endAddedDistance = 0;
maskClosed = 0;

easyArrowComplete = effect("Easy Arrow Completion")("ADBE Slider Control-0001");

if (easyArrowComplete < 0) easyArrowComplete = 0;
else if (easyArrowComplete > 100) easyArrowComplete = 100;
if (maskClosed == 1)
easyArrowComplete *= 0.33333333333333;
newTime = easyArrowComplete/100;

if (maskClosed == 1)
newTime += 0.33333333333333;
totalAddedDistance = beginAddedDistance + endAddedDistance;
newTime = newTime*(1-totalAddedDistance/totalDistance)+(beginAddedDistance/totalDistance);
mask = thisComp.layer(pathLayer)("ADBE Transform Group")("ADBE Position").valueAtTime(newTime);

xPos = mask[0] + thisComp.layer(index)("ADBE Transform Group")("ADBE Position")[0];
yPos = mask[1] + thisComp.layer(index)("ADBE Transform Group")("ADBE Position")[1];
[xPos,yPos]


motion graphics | VFX | web design | etc.
http://paulroper.com/


Return to posts index

Xavier Gomez
Re: Expression not allowing me to substitute a layer name for a layer pop-up variable
on Sep 12, 2016 at 11:20:18 am

Try replace thisComp.layer(pathLayer) by simply: pathLayer

Not sure it will be compatible with the script's expression, but it should at least fix the error.

Xavier


Return to posts index

Paul Roper
Re: Expression not allowing me to substitute a layer name for a layer pop-up variable
on Sep 12, 2016 at 12:15:35 pm

Yep, that totally fixed it! Thanks Xavier!

motion graphics | VFX | web design | etc.
http://paulroper.com/


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]