
Let’s say you’ve tracked an object in a scene and would like to apply a Video Copilot’s Optical Flares to the general location. By quick whipping the flare position to the tracked NULL’s position you wont be able to offset the location of the flare. With this little snippet you’ll be able to by adjusting the anchor point of the NULL.
posX = thisComp.layer("flare tracker").transform.position[0]
posY = thisComp.layer("flare tracker").transform.position[1]
diffX=thisComp.layer("flare tracker").transform.anchorPoint[0]
diffY=thisComp.layer("flare tracker").transform.anchorPoint[1]
X=posX-diffX;
Y=posY-diffY;
[X,Y]
Here is what’s happening: We are subtracting the original position of the tracker with the anchor point and reapplying the value to X/Y. It’s quite simple. Add this to your snippet library and you’re off and running!