Activity › Forums › Adobe After Effects › Position over time relative to width of comp
-
Position over time relative to width of comp
Posted by David Lennox on April 23, 2013 at 9:04 amHi
I’m trying to find an expression that will control the position of a layer over the time of the comp relative to the width of the comp.
So move layer from x=0 to x =100% the width of the comp over the length/time of the comp.
I looked into thisComp.width and thisComp.duration but keep hitting dead ends. Any help appreciated, thanks.
Walter Soyka replied 13 years ago 3 Members · 5 Replies -
5 Replies
-
John Cuevas
April 23, 2013 at 11:57 amOne method would be to use an ease expression added to position.
myTime = thisComp.duration;
myWidth = thisComp.width;
y =300;
ease(time,0,myTime,[0,y],[myWidth,y])The expression says that from time 0 to myTime(comp duration) move from 0 to the myWidth(comp Width). You might want to adjust the start postion to a negative number to start your move offscreen. You could change the myWidth to myWidth =thisComp.width+thisLayer.width; that should move the layer offscreen at the finish also.
here’s the project in action:5899_moveexpressionovertime.aep.zip
Johnny Cuevas, Editor
Thinkck.com“I have not failed 700 times. I have succeeded in proving that those 700 ways will not work. When I have eliminated the ways that will not work, I will find the way that will work.”
—THOMAS EDISON on inventing the light bulb. -
John Cuevas
April 23, 2013 at 12:03 pmMade a couple of adjustments so the layer starts and ends offscreen(as long as the anchor point is in the center of the layer)
myTime = thisComp.duration;myWidth = thisComp.width+(thisLayer.width/2);
y =300;
ease(time,0,myTime,[(0-(thisLayer.width/2)),y],[myWidth,y])Here’s an updated project with both methods, one linear and one with easy ease.
5900_moveexpressionovertimev2.aep.zipJohnny Cuevas, Editor
Thinkck.com“I have not failed 700 times. I have succeeded in proving that those 700 ways will not work. When I have eliminated the ways that will not work, I will find the way that will work.”
—THOMAS EDISON on inventing the light bulb. -
David Lennox
April 23, 2013 at 7:01 pmPicking up an existing project with about 50 comps needing this and I just wondered if there was an easy way to do it with expressions. I know if doesnt save me that much time but still I wondered 🙂
-
Walter Soyka
April 23, 2013 at 8:39 pm[Dave LaRonde] “I’m not entirely sure how long it would take to copy and paste an expression.”
Super-speedy.
Add the expression to one layer. Select the property, then Edit > Copy Expression Only. You only need to do this once.
From there on out, select a layer you want to apply the expression to and hit Ctrl-V (Cmd-V on a Mac). You can do this as many times as you like while the expression is on the clipboard.
Walter Soyka
Principal & Designer at Keen Live
Motion Graphics, Widescreen Events, Presentation Design, and Consulting
RenderBreak Blog – What I’m thinking when my workstation’s thinking
Creative Cow Forum Host: Live & Stage Events
Reply to this Discussion! Login or Sign Up