-
Determining the coordinates of a point on a circle
Hello everyone,
I’m currently working on an After Effects project and encountering a challenge with an expression. I would greatly appreciate your expertise in helping me identify and resolve the issue.
Objective:I am trying to control the position of a point on a circle using an expression. The circle is part of a layer named “TraceArc,” and I’m adjusting the position based on a percentage control named “C1.”
Current Code:
poscentre = thisComp.layer("TraceArc").transform.position;
rayon = (thisComp.layer("TraceArc").content("Ellipse 1").content("Tracé d'ellipse 1").size) / 2;
curseur = (thisComp.layer("TraceArc").effect("C1")("Curseur")) / 100;
angle = 2 * (Math.PI) * curseur;
cosangle = Math.cos(angle);
sinangle = Math.sin(angle);
posx = poscentre[0] + rayon * cosangle;
posy = poscentre[1] + rayon * sinangle;
[posx, posy]
Description of the Problem:
Despite my efforts, I’m encountering an error, “Unable to apply set on more than one value.” I’ve tried various adjustments, but the issue persists.
Request for Assistance:I would appreciate any insights or corrections you can provide on the code. If there’s a better approach to achieve my goal, please let me know.Thank you in advance for your help !