Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions tentacle made with createPath(points

  • tentacle made with createPath(points

    Posted by Pierre Josserand on September 30, 2019 at 1:51 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.

    Pierre Josserand replied 6 years, 7 months ago 2 Members · 3 Replies
  • 3 Replies
  • Alex Printz

    September 30, 2019 at 4:28 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

  • Alex Printz

    September 30, 2019 at 4:29 pm

    Oops, you forgot a paranthesis on your last point:

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

    Alex Printz
    Mograph Designer

  • Pierre Josserand

    October 1, 2019 at 9:40 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

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