ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

create a path with expressions and use methods like pointOnPath

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Arne Münch
create a path with expressions and use methods like pointOnPath
on Jun 17, 2020 at 2:01:01 am

Hi forum
How can I create a path with expressions and use methods like pointOnPath etc. later within the same expression?
For example this expression on the source of a textlayer doesnt output [0,0] as expected. It outputs the middlepoint of the original path.

originalPath = thisComp.layer("Pathlayer").content("Form 1").content("Path 1").path
correctedPath = originalPath;
correctedPath.createPath([[-100,0] , [100,0]] , [] , [] , originalPath.isClosed());
correctedPath.pointOnPath(.5,time);

Any ideas?
Thanks so much.

https://www.instagram.com/arnemuench/


Return to posts index

Robert Müller
Re: create a path with expressions and use methods like pointOnPath
on Jun 17, 2020 at 10:07:50 am

Hi Arne,
As far as I know you can only create paths on a path object, like in a shape layer or on a mask. And since the expression can only effect the property it's applied to, the path stays the same


Return to posts index

Arne Münch
Re: create a path with expressions and use methods like pointOnPath
on Jun 17, 2020 at 5:17:19 pm

Hi Robert
thanks for your reply.
but i dont really get it. Even when you try to use it in the path expression (what I want, the text layer was only for print out the variable) it doesn´t work. Type this in the path property:
originalPath = thisProperty;
correctedPath = originalPath;
correctedPath.createPath([[-100,0] , [100,0]] , [] , [] , originalPath.isClosed());
midpoint = correctedPath.pointOnPath(.5,time);

createPath([ midpoint , [100,0]] , [] , [] , originalPath.isClosed());

And you would expect the first vertex at [0,0] but it isn´t, it is in middle of what ever the originalPath was.
How can I create a path and use its attributes afterwards in the same expression?

https://www.instagram.com/arnemuench/


Return to posts index


Robert Müller
Re: create a path with expressions and use methods like pointOnPath
on Jun 18, 2020 at 9:07:13 am

Okay it seems like the pointOnPath expression needs a drawn path to calculate. But since you are using expressions to draw your path there should be other ways to calculate the mid point.


Return to posts index

Arne Münch
Re: create a path with expressions and use methods like pointOnPath
on Jun 21, 2020 at 10:11:39 pm

hi again
i actually found another solution for my expression, but the question is still interesting. i don‘t think its easily possible to calculate the point at a given percentage on a path without using pointOnPath. if it is possible at all, i guess its quite complicated beziercurve calculations.

so i just want to be sure.
does nobody know if there is a method for creating a path with expressions and using methods like pointOnPath and normalsOnPath afterwards within the same expressions??

seems strange for that this shouldn‘t be doable.
thanks for any hints..

https://www.instagram.com/arnemuench/


Return to posts index

Filip Vandueren
Re: create a path with expressions and use methods like pointOnPath
on Jun 22, 2020 at 6:21:43 am

Not necessarily so strange:
The path you create in JavaScript is actually just an object that contains only the instructions a different piece of the AE-codeset needs to draw that bezier.
Similarly, using pointOnPath is probably querying the bezier-drawing part of AE to calculate the result. So I think the bezier-Math isn’t actually accessible directly within the expression.
Hope I’m making sense, and just speculating though.



Return to posts index


Arne Münch
Re: create a path with expressions and use methods like pointOnPath
on Jun 22, 2020 at 7:40:40 am

thank you Filip
Yes,makes sense.
Always good to hear if something is not possible to let go the ideas and stop thinking that I just missed something.

https://www.instagram.com/arnemuench/


Return to posts index

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