Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE AFTER EFFECTS: ForumAE BasicsAE ExpressionsTutorialsArticlesPodcastsMotion GraphicsTrainingCinema 4D

Get original value of a property 'before' the expression is executed!

Cow Forums : Adobe After Effects Expressions
cow
Get original value of a property 'before' the expression is executed!
by peter menich on Jun 27, 2008 at 2:10:31 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

Respond to this post     Return to posts index

cow
Re: Get original value of a property 'before' the expression is executed!
by Dan Ebberts on Jun 27, 2008 at 3:28: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



Respond to this post     Return to posts index

cow
Re: Get original value of a property 'before' the expression is executed!
by peter menich on Jun 27, 2008 at 3:59:27 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'!



Respond to this post     Return to posts index


cow
Re: Get original value of a property 'before' the expression is executed!
by peter menich on Jun 27, 2008 at 4:48:52 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



Respond to this post     Return to posts index

cow
Re: Get original value of a property 'before' the expression is executed!
by Dan Ebberts on Jun 27, 2008 at 4:59:36 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




Respond to this post     Return to posts index

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>


FORUMSTUTORIALSMAGAZINEDVDsBOOKSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]