Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions This simple expression doesn’t work! Why?

  • This simple expression doesn’t work! Why?

    Posted by Mostafa Talebi on August 31, 2011 at 4:53 pm

    I want my layer to loop only if my layer’s fill effect’s red color isn’t black.set to the other color it loop, but set to black it doesn’t loop.this statements just don’t work out; i have set keyframes and with the expression make them loop! but in either cases it keep looping out.

    THANKS

    //loop only if there is not black color in fill effect of the layer
    if ( effect("Fill")("Color") != [0,0,0,0] ){
    loopOut("cycle",0);
    }

    Darby Edelen replied 14 years, 8 months ago 3 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    August 31, 2011 at 5:04 pm

    Try it this way:


    C = effect("Fill")("Color");
    if (C[0] > 0 || C[1] >0 || C[2] >0){
    loopOut("cycle",0);
    }else{
    value;
    }

  • Darby Edelen

    August 31, 2011 at 9:31 pm

    The reason I would guess this doesn’t work is because a Fill effect’s color is always going to have an alpha of 1. So your color from the Fill effect can never equal [0,0,0,0] (the 4th term is alpha).

    Darby Edelen

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