• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Custom Lensflare Expression

Guest
Aug 01, 2010 Aug 01, 2010

Copy link to clipboard

Copied

Hi

i'm creating an own lensfare.I have created all elements and i'm struggling with the position expression of the iris elements.

Can anyone point me in the right direction how to create the following expression=>

Example:When i move the source point of the flare to the right i want certain elements move to the left accordingly,like the build in Lensflare in after effects does.You know what i mean.Well,just pickwhiping and add *-1 doesn't really work. 

any help appreciated

TOPICS
Expressions

Views

1.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 01, 2010 Aug 01, 2010

Copy link to clipboard

Copied

Assuming your main flare element is a layer named "flare", an expression like this will position a layer on the line that goes through the flare and the center of the comp window. Adjust "mult" to set how far, relative to the distance between "flare" and the center. -1 puts it the same distance but on the other side. 0.5 would put it on the same side but half as far. You'll see...

mult = -1;
flare = thisComp.layer("flare");
compCenter = [thisComp.width,thisComp.height]/2;
compCenter + mult*(flare.toComp(flare.anchorPoint) - compCenter);

Dan

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 01, 2010 Aug 01, 2010

Copy link to clipboard

Copied

Hi dan

Thank you very much.It works of course ;-).

Any chance to make it work in 3d as well?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 01, 2010 Aug 01, 2010

Copy link to clipboard

Copied

It's hard to picture how that would work, but you might play around with this, which keeps everything relative to the camera's POI:

mult = -1;
flare = thisComp.layer("flare");
center = thisComp.layer("Camera 1").transform.pointOfInterest;
center + mult*(flare.toWorld(flare.anchorPoint) - center);

Dan

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Aug 03, 2010 Aug 03, 2010

Copy link to clipboard

Copied

LATEST

Hi there,

Yep,it works but Orientation looks a bit strange.Layers always look at the 3d world center.

cheers

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines