PDA

View Full Version : expressions: move to point over comp duration


aeType
03-22-2008, 12:51 AM
Greetings

i am looking to move an anchor point of my effect over from 0 to 800pixels at all times no mather what comp duration it is. fe one is 15 seconds long the other 3.54mins.

can anyone shed a light how to do this via expressions?

i found out that value*time brings me a step further but i am in doubt how to correctly do all this.

much thanks in advance

aeType
03-22-2008, 02:11 AM
so far i found this through the help files, needless to say i am completely new to expressions,

xPos =time * 0.30
yPos = value[1] ;
if (xPos < 800){
[xPos, yPos];
}else{ [800 , yPos ] ; }


now the motion nicely stops at 800.

yet the duration of the "effect" is no where close to the duration of the composition

i read time stands for the current playhead if i am correct so i am a bit stuck now

yikesmikes
03-22-2008, 05:10 PM
Hacking on your expression, this seems to do what you want:

xPos =time * 800/thisComp.duration;
yPos = value[1] ;
if (xPos < 800){
[xPos, yPos];
}else{ [800 , yPos ] ; }

Here is a little mod so you only have to enter the 800 once:

AnchorMove = 800;
xPos =time * AnchorMove/thisComp.duration;
yPos = value[1] ;
if (xPos < AnchorMove){
[xPos, yPos];
}else{ [AnchorMove , yPos ] ; }

Here are the best two links for expression self-ed:

http://www.jjgifford.com/expressions/basics/index.html

http://www.motionscript.com/

aeType
03-22-2008, 05:17 PM
Brilliant, thank you, now my project will be quite a lot sped up


i was unware to get to my value as such "time * 800 / thisComp.duration"
did you find that by testing? or merely math knowledge? or even better, was the answer obvious? it feels kinda weird not finding this myself

thats pretty nice done, thanks also for the links, i'll defo spend a fair amount of time over these wonderfull expressions

many warm greets

yikesmikes
03-22-2008, 06:13 PM
I just hack other peoples's expression,s mostly Dan Ebberts.

A good way to find what's avaiable is to click on that little triangle next to the pickwhip when your expression is open, "duration" was under Comp, the expression just needed to know which comp.

Here is another good place for expressions, scripts also:

http://www.aenhancers.com/

CGTalk Moderation
03-22-2008, 06:13 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.