Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Light positions using Corner Pin?

  • Light positions using Corner Pin?

    Posted by Adam Taylor on July 24, 2014 at 10:59 am

    I have a null with corner pin data from Mocha and i want to use this data to position four Lights, one at each corner.

    It works but only partially, and i am unclear how to solve it.

    The problem seems to be that when i pickwhip the corner pin data, The 2d position gets transformed into 3d on the Light, with the z position just duplicating the y position. This ends up hiding the Light behind all the layers!

    i cannot figure out how to replace this 3rd dimension with a fixed point. Every thing i try just throws up errors.

    Is this even possible? and if so, how?

    thanks
    Adam

    Adam Taylor
    Video Editor/Audio Mixer/ Compositor/Motion GFX/Barista
    Character Options Ltd
    Oldham, UK

    http://www.sculptedbliss.co.uk
    My YouTube Animations Page

    Tom Holmes replied 11 years, 10 months ago 3 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    July 24, 2014 at 4:18 pm

    Maybe you just need to stick your pickwhipped value into a variable and only use the x and y, like this:

    temp = (your pickwhipped value goes here);
    [temp[0],temp[1],value[2]]

    Instead of value[2], you could also substitute any z value you want.

    Dan

  • Tom Holmes

    July 24, 2014 at 4:19 pm

    Hi Adam,

    You will need to put this as an array,

    Try this:

    Drop down the position of the first light (hit ‘p’) Alt-click on the stopwatch to open expression editor. type ‘[‘ and then pickwhip the X value for the corner you want this light to be attached to, then type ‘,’ and pickwhip the Y value for the same point, then add another comma and then pickwhip to the lights own Z value (this will allow it to be adjusted)

    The position expression of the light should then look something like this (with your layer/effect names):

    [thisComp.layer(“Adjustment Layer 1”).effect(“Corner Pin”)(“Upper Left”)[0],thisComp.layer(“Adjustment Layer 1”).effect(“Corner Pin”)(“Upper Left”)[1],transform.position[2]]

    Repeat this step for each light to each other the other points.

    then set the Z value for each of the lights depending on how far forward in Z space you want them.

    I hope this helps!

    Tom

    [thisComp.layer("Adjustment Layer 1").effect("Corner Pin")("Upper Left")[0],thisComp.layer("Adjustment Layer 1").effect("Corner Pin")("Upper Left")[1],transform.position[2]]

  • Tom Holmes

    July 24, 2014 at 4:21 pm

    Dan you beat me to it haha,

    Adam don’t listen to me when Dan’s about haha…

    I still need your help on my expression issue Dan! 🙂

    Tom

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