Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions dan’s “Layer Invisible When Facing Away” expression quick question

  • dan’s “Layer Invisible When Facing Away” expression quick question

    Posted by Al on December 3, 2008 at 9:13 am
    if (toCompVec([0, 0, 4335])[2] > 0 ) value else 0

    if (toCompVec([0, 0, 4335])[2] > 0 ) value else 0

    i’m following Dan’s “Layer Invisible When Facing Away” expression, incredibly useful that it is!! Just have a quick question. Here’s the expression i’m referring to:

    if (toCompVec([0, 0, 4335])[2] > 0 ) value else 0

    i can understand each aspect of the expression, except for

    [2] > 0

    What is the 2 for? And what is the (presumably) Less Than Zero for?

    Would really appreciate thoughts (especially ones for non-expression peoples like myself!)

    Dan Ebberts
    replied 17 years, 5 months ago
    2 Members · 1 Reply
  • 1 Reply
  • Dan Ebberts

    December 3, 2008 at 2:16 pm

    Yikes. Where did the 4335 come from?

    In any case, the [2] just tells the expression to look at the z component of the vector created by toCompVec(). Then, if that value is greater than zero (>) it leaves the opacity alone, othwise (meaning the layer is facing away from the camera/comp view) it sets the opacity to zero.

    Hope that helps.

    Dan

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