ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Parent Identify

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Mac Lad
Parent Identify
on Nov 29, 2017 at 7:56:08 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];


Return to posts index

Scott McGee
Re: Parent Identify
on Nov 29, 2017 at 11:19:51 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


Return to posts index

Mac Lad
Re: Parent Identify
on Dec 1, 2017 at 9:28:30 am

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


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]