Why does the shape randomly rotate 180deg from where it is expected
- February 17, 2023
- 4 replies
- 1202 views
As per title, why’d does the arrowhead shape rotate 180 from the expected orientation randomly?
Please see linked video: https://youtu.be/WjvBc6ee1l4
How can I fix this to keep the orientation consistent?
I have a line path with the ends following nulls.. so I can easily select the null and move the line endpoints.
I have an expression on the Shape (triangle) postion and rotation to position and orient it at the end of the line.
Position the arrow at end of the line:
shapeGroup = thisComp.layer("Shape Layer 1").content("The Line");
myPath = shapeGroup.content("Path 1").path;
endPt = myPath.pointOnPath(1);
Orient the arrow to the end of the line:
shapeGroup = thisComp.layer("Shape Layer 1").content("The Line");
myPath = shapeGroup.content("Path 1").path;
tg = myPath.tangentOnPath(1.0);
a = Math.atan2(tg[1],tg[0]); radiansToDegrees(a)-30;
Thanks in advance.
