Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Optical Flares Distance from Camera

  • Optical Flares Distance from Camera

    Posted by Oliver Smith on February 13, 2012 at 12:49 pm

    Hi,

    I’ve got a setup which works well for everything except Optical Flares. Ok, to explain:

    Ive got a sphere and animated camera exported from c4d into AFX. Then I have Trapcode Particular flying lines around the sphere from light emitters created within AFX. To make it look like the lines are going behind the sphere layer I applied this script to the Focus Distance of the camera (with DOF switched off) and a layer called target at 0, 0, 0 – Thanks Dan Ebberts!

    target = thisComp.layer(“target”);
    v1 = target.toWorld(target.anchorPoint) – toWorld([0,0,0]);
    v2 = toWorldVec([0,0,1]);
    dot(v1,v2)

    Which creates a value from how far there camera is from the target layer at 0, 0, 0

    Then I pick whipped the far vanish of the Particular to this changing value. Now wherever the camera flies, the lines disappear when they get past the centre of the sphere (which is also at 0, 0, 0).

    I want to do this for the Optical Flares which follow the same light emitters, but there isn’t any far vanish control in Optical Flares.

    Is there a way I can use this same value from the camera distance to switch on and off the lights. Something like – if the value is higher than the pick whipped number then set brightness (in Optical Flares) to 0, if it is less than the pick whipped number then set the brightness to 100 (or whatever).

    Is this possible?
    Thanks
    Oliver

    target = thisComp.layer("target");
    v1 = target.toWorld(target.anchorPoint) - toWorld([0,0,0]);
    v2 = toWorldVec([0,0,1]);
    dot(v1,v2)

    Oliver Smith replied 14 years, 2 months ago 1 Member · 0 Replies
  • 0 Replies

Sorry, there were no replies found.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy