ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

tentacle made with createPath(points

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Pierre Josserand
tentacle made with createPath(points
on Sep 30, 2019 at 1:51:03 pm

hello everyone,

i'm learning how to make a shape with the createPath(points expression to make an octopuss tentacle drive by another path

i made my driver path with only 3 points beginning, middle and end, and i created another shape layer, where i parents my tentacle path to my driver path ( hope i'm not loosing everyone : p) my goal is that a tentacle is made from my driver path, that is thicker at the base and narrower at the top.

so my expression is :

thickness = 100
path = thisComp.layer("Driver").content("Tracé 1").path
pList = [
path.pointOnPath(0) + (path.normalOnPath(0)*thickness),
path.pointOnPath(0.2) + (path.normalOnPath(0.2)*(thickness*.8)),
path.pointOnPath(0.4) + (path.normalOnPath(0.4)*(thickness*.6)),
path.pointOnPath(0.6) + (path.normalOnPath(0.6)*(thickness*.4)),
path.pointOnPath(0.8) + (path.normalOnPath(0.8)*(thickness*.2)),
path.pointOnPath(1),
path.pointOnPath(0.8) + (path.normalOnPath(0.2)*(thickness*-.2)),
path.pointOnPath(0.6) + (path.normalOnPath(0.4)*(thickness*-.4)),
path.pointOnPath(0.4) + (path.normalOnPath(0.6)*(thickness*-.6)),
path.pointOnPath(0.2) + (path.normalOnPath(0.8)*(thickness*-.8)),
path.pointOnPath(0) + (path.normalOnPath(0)*-(thickness),
]

createPath(points = pList, inTangents = [], outTangents = [], is_closed = true)


but i have an error saying :
error on line 15
] has no value..

I'm sure i missed something on my tutorial but can't see what so i come for help and advice to better understand my mistake, thanks a lot.


Return to posts index

Alex Printz
Re: tentacle made with createPath(points
on Sep 30, 2019 at 4:28:03 pm

Try this, i'm guessing 'path' can't be used as your variable since it's usually a reserved word. EIther that, or in the createPath the '=' symbols are breaking your code.

thickness = 100;
targetPath = thisComp.layer("Driver").content("Tracé 1").path;
pList = [
targetPath.pointOnPath(0) + (targetPath.normalOnPath(0)*thickness),
targetPath.pointOnPath(0.2) + (targetPath.normalOnPath(0.2)*(thickness*.8)),
targetPath.pointOnPath(0.4) + (targetPath.normalOnPath(0.4)*(thickness*.6)),
targetPath.pointOnPath(0.6) + (targetPath.normalOnPath(0.6)*(thickness*.4)),
targetPath.pointOnPath(0.8) + (targetPath.normalOnPath(0.8)*(thickness*.2)),
targetPath.pointOnPath(1),
targetPath.pointOnPath(0.8) + (targetPath.normalOnPath(0.2)*(thickness*-.2)),
targetPath.pointOnPath(0.6) + (targetPath.normalOnPath(0.4)*(thickness*-.4)),
targetPath.pointOnPath(0.4) + (targetPath.normalOnPath(0.6)*(thickness*-.6)),
targetPath.pointOnPath(0.2) + (targetPath.normalOnPath(0.8)*(thickness*-.8)),
targetPath.pointOnPath(0) + (targetPath.normalOnPath(0)*-(thickness),
];

createPath(pList, [], [], true)


Alex Printz
Mograph Designer


Return to posts index

Alex Printz
Re: tentacle made with createPath(points
on Sep 30, 2019 at 4:29:28 pm

Oops, you forgot a paranthesis on your last point:

targetPath.pointOnPath(0) + (targetPath.normalOnPath(0)*-(thickness)),

Alex Printz
Mograph Designer


Return to posts index


Pierre Josserand
Re: tentacle made with createPath(points
on Oct 1, 2019 at 9:40:35 am

Thanks a lot Alex, damn parenthesis, it's like looking for Waldo sometimes!!

so i tried your expression, (and i corrected my last parenthesis :p) and its telling me that targetpath.pointOfPath is not a function, so i took my old expression, back and change my createPath like yours so createPath(plist,[],[],true) and it gave me the same error path.pointOnPath is not a function.

i think i got lost.

for info i'm on after effect CC 2017, i'm not it changes a lot, but i forgot to tell you.

Thanks again for your answer


Return to posts index

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