Copy link to clipboard
Copied
Hi
I managed to a path with the following script (just a line between two layers), but trying to add a third point inbetween them with a slight offset AE does not find the normalOnPath function (trying to bend the line as if ther's a knee/elbow on it). Is it not available on a new createPath() variable?
var ab = createPath(
[toWorld(effect("A")("Layer").position),
toWorld(effect("B")("Layer").position)]
)
createPath(
[toWorld(effect("A")("Layer").position),
ab.normalOnPath()*50,
toWorld(effect("B")("Layer").position)]
)
Copy link to clipboard
Copied
It's a script function, not an expression. They are completely different things based on separate infrastructures and cannot be used interchangeably. For expressions you have to do all the calculations the hard way yourself.
Mylenium
Copy link to clipboard
Copied
That's interesting. Apparently you can't access the path you just created with the path functions (pointOnPath, normalOnPath, etc.). However, I was able to create one path with this:
L1 = effect("A")("Layer");
L2 = effect("B")("Layer");
p1 = fromComp(L1.toComp(L1.anchorPoint));
p2 = fromComp(L2.toComp(L2.anchorPoint));
createPath([p1,p2],[],[],false);
Then create another path (like you're after) by referencing the first one with this:
ab = content("Shape 1").content("Path 1").path;
p1 = ab.pointOnPath(0);
p3 = ab.pointOnPath(1);
p2 = ab.pointOnPath(.5) + ab.normalOnPath(.5)*50;
createPath([p1,p2,p3],[],[],false)
So I guess you could do that, then turn off visibility to the first one. I'm not sure if that helps...