Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Horizontal Flipping Help needed…

  • Horizontal Flipping Help needed…

    Posted by Steve Cardno on March 30, 2008 at 7:59 pm

    Hi there, I’ve never really used much expressions before so apologies for my ignorance, but I’m after something that can create this:

    I’d like an expression that can use the scale/position properties of an animated layer and do the exact opposite / a horizontal flip…

    On the left side of the screen I have a layer starting out big and getting smaller and coming in to the center of the screen, this is being used as a parent and then other layers attached, and I need the exact same motion happening symmetrically on the right side to parent my new right hand layers

    I’ve done this for the scale property so far:

    thisComp.layer(“3”).transform.scale*-1

    This has flipped the layer but vertically also, I only want the width effected, I’ve tried adding the (0) property after scale so that it only effects this but it didn’t work…

    Any help would be much appreciated!!
    Thanks,
    Steve

    Steve Cardno replied 18 years, 5 months ago 2 Members · 4 Replies
  • 4 Replies
  • Filip Vandueren

    March 30, 2008 at 8:53 pm

    Hi Steve,

    this is the correct syntax:

    for scale (2D):

    s=thisComp.layer("3").transform.scale;
    [-s[0],s[1]];

    for scale (3D):

    s=thisComp.layer("3").transform.scale;
    [-s[0],s[1],s[2]];

    for position (2D):

    p=thisComp.layer("3").transform.position;
    [comp.width - p[0],p[1]]];

    for position (3D):

    p=thisComp.layer("3").transform.position;
    [comp.width - p[0],p[1],p[2]];

  • Steve Cardno

    March 31, 2008 at 11:04 am

    Hey Filip, thanks for your response!

    The scale has worked perfect thanks, but I get an AE warning when entering the 2d position property: Class ‘Function’ has no property or method named ‘width’

    p=thisComp.layer(“3”).transform.position;
    [comp.width – p[0],p[1]];

    Any suggestions?

    I have actually got it all working now, but that’s been by doing math – copying all the keyframe information, finding the difference between them and applying that to the flipped layer once first frame is in exact position

    Thanks again,
    Steve

  • Filip Vandueren

    March 31, 2008 at 11:12 am

    Oops,

    that should have been:

    p=thisComp.layer(“3”).transform.position;
    [thisComp.width – p[0],p[1]];

  • Steve Cardno

    April 1, 2008 at 7:58 pm

    Thanks Filip, that’s worked spot on!

    Steve

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