Placing Null In A Circle
I'm trying to rig a pie chart in After Effects, I am currently having trouble with placing the nulls for call-outs.
With some fiddling, I was able to get close to what I wanted to achieve, but now I have this problem:
This is how my expression works:
This is how I wanted it to work:
Here is my expression:
There will be a lot of duplicating, so I tend to put expressions with loops to a slider and get the values from there.
"Angle Per Part" is just 360 / number of layers with the name "Pie Part" in it (in this example, 360 / 6 = 60);
"Ident" is the number assigned to the layer, Callout 01, Callout 02 (hence split(" "))
Better yet, is there a way to modify my expressions so that I can freely rotate the entire thing using expression controls?
Are these shapelayers you created, or imported PSD-layers, or just one graphic that you are masking ?
What exactly do you want to do, and why do you need expressions for it ?
I managed to get it to work. Sorry if the initial post is unclear.
I'll clarify. The pie parts are just comp sized shape layers with the effect radial wipe applied, they respond to input sliders in a special layer. Then I masked the entire layer with a donut shape layer.
Basically what I wanted to achieve is to make null objects stick to the middle of a pie part at all times, and which pie part sticks depends on its layer name, so null object "callout 01" will stick to the middle of "pie part 01" at all times.
With parametric equation for circles, I was nearly there, but that's when I encountered the issue where my null objects are where they're supposed to be, but +90 degrees off. But that's not all, I need it that when I duplicate the callout null, the new null will follow the rotation in counter clockwise.
So I added an angle control so I can control the start angle to my liking, calculated the percentage of the pie to an angle, then divided it by two.
Voila, the null objects are stuck to the pie parts.
Here's the expression I wrote, it's not very elegant or anything, but it works.
Took me 7 hours because I'm so bad with maths lol.