Colin Braley
Forum Replies Created
-
Colin Braley
November 10, 2005 at 12:39 am in reply to: Expression for circles following a curved path?Michael –
I’ve got an expression that seems to work pretty well, but I’m not sure if it is exactly what you are looking for. Just keyframe the position of the first layer and then apply this expression to the position property of all the other circles (they must be directly below the other circles in the timeline because the expression relies on layer indicies). Well, here is the expression://Begin expression
offSet = 500;//In pixels
//—–
frame = timeToFrames(time);
prevPos = thisComp.layer(index – 1).position;
var finalPos;
//–
function getPrevPosAtTime( f )//Time in frames is passed to the function
{
return prevPos.valueAtTime( framesToTime( f ));
}
//–
var bestFrame = 0;
//–
for(i = 0; i < frame; i++) { curr = length(getPrevPosAtTime( i ), prevPos); currError = Math.abs(curr - offSet); oldCurr = length(getPrevPosAtTime( bestFrame), prevPos); oldError = Math.abs(oldCurr - offSet); if(currError < oldError) bestFrame = i; } //-- getPrevPosAtTime( bestFrame ) //End expression I think that expression should get you headed in the right direction. If you have any trouble with it post again. ~Colin -
Well scale is a two dimensional property, meaning the first number is X scale and then Y scale. When you type random(100, 120) you are only specifying the X scale so after effects is telling you it needs a number for Y scale too. You might want to try one of hese expressions:
val = random(100, 120);
[val, val]//or
[random(100, 120), random(100,120)]
for this kind of basic expression stuff you can usually find the answer on Dan Ebberts’ site http://www.motionscript.com
~Colin
-
Well scale is a two dimensional property, meaning the first number is X scale and then Y scale. When you type random(100, 120) you are only specifying the X scale so after effects is telling you it needs a number for Y scale too. You might want to try one of hese expressions:
val = random(100, 120);
[val, val]//or
[random(100, 120), random(100,120)]
for this kind of basic expression stuff you can usually find the answer on Dan Ebberts’ site http://www.motionscript.com
~Colin
-
You can’t keyframe (or add expressions to) a layers transfer mode. You can just split the layer and change the transfer mode at a specific point in time. If it is required that you set many keyframes of a layer’s blending mode I recommend checking out the Channel > Calculations effect.
~Colin
-
You can’t keyframe (or add expressions to) a layers transfer mode. You can just split the layer and change the transfer mode at a specific point in time. If it is required that you set many keyframes of a layer’s blending mode I recommend checking out the Channel > Calculations effect.
~Colin
-
I forgot to include the part that would round off the decimals when I originally posted. Try this:
beginNum = 50000000;//Beginning number of counter
endNum = 10;//Ending number of counter
duration = 3;//duration of count down in seconds
Math.round( linear(time, 0, duration, beginNum, endNum) )all I did to round the number was used the statement Math.round(). To round a number to the nearest whole number use this, to make a number go up to the next whole number use Math.ceiling() and to simply drop the decimals (make it go down to the lower number) use Math.floor(). These prove invaluable when working with numbers. As for making the 10 line up in the proper place you need to set the anchor point of the text to a different spot. Refer to the manual or online help within AE to learn more about this if you don’t know what it is. Well that’s it, glad I could help.
~Colin
-
I forgot to include the part that would round off the decimals when I originally posted. Try this:
beginNum = 50000000;//Beginning number of counter
endNum = 10;//Ending number of counter
duration = 3;//duration of count down in seconds
Math.round( linear(time, 0, duration, beginNum, endNum) )all I did to round the number was used the statement Math.round(). To round a number to the nearest whole number use this, to make a number go up to the next whole number use Math.ceiling() and to simply drop the decimals (make it go down to the lower number) use Math.floor(). These prove invaluable when working with numbers. As for making the 10 line up in the proper place you need to set the anchor point of the text to a different spot. Refer to the manual or online help within AE to learn more about this if you don’t know what it is. Well that’s it, glad I could help.
~Colin
-
Try this:
-Twirl down the properties for your text layer. (you should see the text and transform properties)
-Twirl down the “text” property
-You should see an animatable value called sourcetext.
-Alt + click on the stopwatch and paste in my expression
-(instead of alt + clicking you can hightlight the property and go to animate > add expression if you want)
-That should be all you need to do~Colin
-
Try this:
-Twirl down the properties for your text layer. (you should see the text and transform properties)
-Twirl down the “text” property
-You should see an animatable value called sourcetext.
-Alt + click on the stopwatch and paste in my expression
-(instead of alt + clicking you can hightlight the property and go to animate > add expression if you want)
-That should be all you need to do~Colin
-
I am not in front of my AE right now but you could try this:
– Create a new text layer
-add the following expression to sourcetext://–Begin expression
beginNum = 50000000;//Beginning number of counter
endNum = 10;//Ending number of counter
duration = 3;//duration of count down in seconds
linear(time, 0, duration, beginNum, endNum)//–End expression
~Colin