Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Parent Identify

  • Posted by Mac Lad on November 29, 2017 at 7:56 am

    Hi Awesome Peoples,
    I m using a layer which has an expression on it. I want to use if else statement on position which can identify whether the layer is parented or not. If it is parented the expression will not work and take its original values flowing from parent else it will run expression. I m using below expression, it works fine when parented but gives an error when unparented and also wiggle expression don’t work.

    l=thisLayer;
    If(parent.l=1){parent.transform.position[0]};
    else{wiggle(1,10)};
    [x,y];

    Mac Lad replied 8 years, 8 months ago 2 Members · 2 Replies
  • 2 Replies
  • Scott Mcgee

    November 29, 2017 at 11:19 am

    Hey

    A few things are wrong with this

    a few notes

    1: capital I in if, won’t work.
    2: it should be thisLayer.parent, rather than the other way round.
    3: if the parent exists .hasParent is the way to write this rather than “= 1”
    4: because x and y exists at the bottom rather than in the top part of if, wiggle needs to have x and y values, which is doesn’t

    l=thisLayer;
    if (l.hasParent){
    x = l.parent.position[0];
    y = value[1];
    [x,y];
    } else {
    wiggle(1,10);
    }

    This should work

  • Mac Lad

    December 1, 2017 at 9:28 am

    Ohhh..that is the great piece of info…Thanks for the awesome help!! It worked!!

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