Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Get original value of a property ‘before’ the expression is executed!

  • Get original value of a property ‘before’ the expression is executed!

    Posted by Peter Menich on June 27, 2008 at 2:10 pm

    Hi All,

    So I have an expression that changes a layers position.

    But I want to link another layer to its position (from another comp, so no parenting possible) before the expression was added.

    Is this possible?

    A kind of ‘get the position value of layer X as if the expression wasn’t really there’ sort of thing.

    I could write an expression that reverses the original expression, but its really complicated trigonometry expression and my brain won’t take it!

    I’m hoping there’s an easier way

    cheers

    Pete

    Dan Ebberts
    replied 17 years, 10 months ago
    2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    June 27, 2008 at 3:28 pm

    You might be able to re-work your expression so that you can apply it to the position property of a Transform effect. That will leave that actual Positon property unaffected so you can access it from the other layer.

    Dan

  • Peter Menich

    June 27, 2008 at 3:59 pm

    Hey Dan,

    No dice I’m afraid; its that 3D globe names thing again.

    The layer has 3D turned on and an expression applied to move its position into a sphere.

    I need to be able to get the x and y of the layer before the expression was applied.

    I’m basically setting up a template project so you just select the countries name and the globe will spin around to that country (for Ole’s site)

    I wish there was a way of getting values out of expressions to other layers at particular points in the expression!

    Say; ‘get value for x and y at line 1 of this expression on layer X’!

  • Peter Menich

    June 27, 2008 at 4:48 pm

    I think I’ve gotten around it…

    I don’t need the new value to start straight away, so I used a ‘linear(t, tMin, tMax, value1, value2)’
    to map the values from original to new in the first frame.

    Then in the second layer I used the ‘valueAtTime()’ to get the value at 0 time.

    Seems to do what I wanted

    WooHoo! bring on the weekend

  • Dan Ebberts

    June 27, 2008 at 4:59 pm

    Ah yes, I forgot about the old negative time trick. You can map the target layer’s pre-expression position into negative time like this:

    if (time <= 0){ valueAtTime(-time) }else{ // your expression goes here } Then retreive it from the other layer like this: comp("main comp").layer("target").transform.position.valueAtTime(-time) Dan

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