ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Problem with long createPath in AE 15

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Juan Irache
Problem with long createPath in AE 15
on Sep 26, 2019 at 12:14:52 am

Hi guys,

I'm usually working on AE 16, but my current project should be usable for people running 15. After some tweaking of the syntax I got all my expressions working, but some of my paths look incomplete. I found out createPath seems to be limited to 1000 points in AE 15 (in 16 it draws at least 9000 without a problem). An easy way to replicate the problem is to create a shape and set this as its path:

path = [];
for (i=0; i<2000; i++) {
path.push([random()*100,random()*200]);
}
createPath(path,[],[],false);


And then visualise the poth length in the Source Text of a text layer:

thisComp.layer("Path").content("Shape 1").content("Path 1").path.points(0).length

AE 15 outputs 1000 as the array length, instead of 2000. Is this a known issue? I could create multiple paths, but this responds to user input, so I never know how long the input will be.


Return to posts index

Dan Ebberts
Re: Problem with long createPath in AE 15
on Sep 26, 2019 at 1:25:09 am

I wasn't aware of the limitation, but it appears that you are correct.

Dan



Return to posts index

Juan Irache
Re: Problem with long createPath in AE 15
on Sep 26, 2019 at 3:34:41 am

This is the solution I came up with, in case anyone else bumps into this.

I added a "Max Path Complexity" slider to my control layer. It's set to 1000 by default. AE 15 users are asked not to increase the value. Lowering it also allows for much faster renders.

The code goes something like this:

mPoints = [];
complexity = +thisComp.layer("Control").effect("Max Path Complexity")(1);
//dataSource is a data array taken from somewhere else
increments = Math.ceil(dataSource.length / complexity);

for (i=0; i<dataSource.length; i += increments) {
mPoints.push(dataSource[i]);
}

createPath(mPoints,[],[],false);


Return to posts index

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