![](https://cdn.myportfolio.com/e08afac7-f9f0-4969-806c-10d59355097b/ae117b9c-8265-43a8-a781-4feb68cfaf4d_rw_1920.jpg?h=ba738e92a7d7d8ef70aaff3eddda66a9)
Step-by-step tutorial with project download.
In this tutorial I use the Circle effect, Fractal Noise, Polar Coordinates and CC Light Rays to create a 2D solar eclipse. Rather than keyframe everything, I use Expressions to drive all the different effects based on just two keyframes.
Expression
MoonPos = effect("Moon position")("Point")[0];
SunPos = effect("Sun position")("Point")[0];
MoonRadius = effect("Radius")("Slider");
if (MoonPos-SunPos < MoonRadius && SunPos-MoonPos < MoonRadius) {
Width = thisComp.width/2;
X = Width + linear(SunPos, Width-MoonRadius*0.05, Width+MoonRadius*0.05, MoonRadius*-1, MoonRadius)
} else {
X = SunPos;
}
[X,effect("Sun position")("Point")[1]]
SunPos = effect("Sun position")("Point")[0];
MoonRadius = effect("Radius")("Slider");
if (MoonPos-SunPos < MoonRadius && SunPos-MoonPos < MoonRadius) {
Width = thisComp.width/2;
X = Width + linear(SunPos, Width-MoonRadius*0.05, Width+MoonRadius*0.05, MoonRadius*-1, MoonRadius)
} else {
X = SunPos;
}
[X,effect("Sun position")("Point")[1]]