Henry,
Here's something really basic I just whipped up that simply
moves layers away from a null. It just pushes objects away
from where the null is when they're closer than the "Distance
Threshold" control. You can increase the amount that they
move with "Move Away Multiplier."
Just paste the position expression from one of the solids
to your own layers and it should work or at least be a
starting point to tinker further. Expression pasted below as
well:
Here's a quick screencapture showing what it does:
And here's the .AEP:
Not fancy but maybe helpful?
- Nathan
p = transform.position;
nullPos = thisComp.layer("Parent And
Controls").transform.position;
distanceThreshold = thisComp.layer("Parent And
Controls").effect("Distance Threshold")("Slider");
moveAwayMult = thisComp.layer("Parent And
Controls").effect("Move Away Muliplier")("Slider");
distance = length(p, nullPos);
if (distance < distanceThreshold) {
distanceMult = (Math.log(distanceThreshold / distance))
* moveAwayMult;
delta = nullPos - p;
nDelta = (normalize(delta));
newPos = p - nDelta * distanceMult;
} else {
p
}