-
Trying to create a path with an array of positions :/
I’m being obtuse here – this should work surely?
The setup: I have Null 1 to Null 11 at indices 1-11. I want to use their positions to create a mask on some footage. Here’s the code I’m using on the mask path property:
let p = [];
for (i = 1; i <=11; i++) {
p[i] = thisComp.layer(i).position;
}
createPath(p, [], [], true)I get the error “argument 1 to createPath must be 2 numbers”. Using this code in the textSource property of a text layer and outputting p.join(‘\r’), I get a string of numbers separated by commas, so the loop is working at least. Array.isArray(p) outputs True. And if I use this as the last line on the path expression, it works:
createPath([[100,100],[200,100],[200,200]], [], [], true)
I’ve used this approach before in other (much more complex) code, so I can’t work it out.