-
Lens Flare position on dynamic text or logo
Hello World,
As I begin the scary world of expressions, I’m stuck and need help.
I have an image layer ‘placeholder’ where a png logo will be placed (replace footage). There will be logos of all different shapes and colors. I want to place a lens flare on the bottom of the logo (not the bounding box, but where the actual pixels begin of the png).
My layer ‘placeholder’ is in it’s own comp ‘logo isolated’. I have this comp in the ‘Main’ composition flying in and then after it settles, a lens flare blooms on the bottom of the logo. The keyframes for the fly-in are on the ‘main’ comp. The ‘placeholder’ doesn’t have any keyframes on the position, scale, rotation, or opacity.
I started by creating a ‘Point Control’ inside the ‘logo isolated’ comp on the ‘placeholder’ layer. I animated the Point Control to start at the bottom (Y) and animated it with keyframes to the top edge of the ‘logo isolated’ comp.
I then was testing a text layer to output to help identify the change in opacity:
targetLayer = thisComp.layer(“placeholder”);
samplePoint = targetLayer.effect(“Point Control”)(“Point”);
sampleRadius = [1,1];
sampledColor_8bpc = 255 * targetLayer.sampleImage(samplePoint, sampleRadius);
A = Math.round(sampledColor_8bpc[3]);
outputString = ASo, as the Point Control moves from bottom to top of the PNG layer on the Y, I can see when the Alpha changes from 0 to some number. My problem is that I can’t figure out is how to identify the Y position value of when the alpha changes. This Y value would then need to be linked to the lens flare position XY on the main comp (and adjusted for position and scaling of ‘logo isolated’). If the Point Control doesn’t encounter any non-transparent pixels as it scans, I guess it wouldn’t retrieve a Y value? I don’t know how to adjust for this situation. It might be easiest to have the lens flare bloom on the bottom or top Y of the main comp (so its half-off screen).
Ideally, I would love for this concept to be able to be applied to text or a png placeholder.
Am I headed in the right direction? Any help would be appreciated.
Also, I’m not a huge fan of how I have to animated the Point Control across the placeholder as this takes time and if I repeat this process in a future project where the lens flare begins on frame 1, I won’t have the time to scan across a png looking for alpha. It would be better if I could scan the placeholder comp for a change in alpha and find the X or Y value without animating the Point Control.
Thanks in advance.
Jimmy