-
Expression not allowing me to substitute a layer name for a layer pop-up variable
Hello,
I have been given a project to work on which contains a comp using the Easy Arrows script (https://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.
https://paulroper.com/