<?xml version="1.0" encoding="utf-8"?> 
<rss version="2.0"
  xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
  xmlns:atom="http://www.w3.org/2005/Atom">

<channel>

<title>3D Library: posts tagged after effects</title>
<link>https://balyberdin.com/library/tags/after-effects/</link>
<description>A curated library of useful motion design insights, tips and tricks for quick reference and practical guidance</description>
<author></author>
<language>en</language>
<generator>Aegea 11.3 (v4134)</generator>

<itunes:subtitle>A curated library of useful motion design insights, tips and tricks for quick reference and practical guidance</itunes:subtitle>
<itunes:image href="" />
<itunes:explicit></itunes:explicit>

<item>
<title>After Effects Expressions Cheat Sheet</title>
<guid isPermaLink="false">4</guid>
<link>https://balyberdin.com/library/all/ae-expressions/</link>
<pubDate>Sun, 24 Nov 2024 17:44:02 +0200</pubDate>
<author></author>
<comments>https://balyberdin.com/library/all/ae-expressions/</comments>
<description>
&lt;p&gt;I’ve put together a list of After Effects expressions that simplify my workflow. You won’t find basics like &lt;f&gt;loopOut()&lt;/f&gt; or &lt;f&gt;wiggle (.4,6)&lt;/f&gt; here, but nothing overly complex either.&lt;/p&gt;
&lt;p&gt;Most of these expressions are taken from the web and adapted to fit my needs, with only a few being entirely my own. I’ve included links to credit the authors where relevant.&lt;/p&gt;
&lt;h2&gt;Adaptive Text Box&lt;/h2&gt;
&lt;div class="half-video"&gt;&lt;div class="e2-text-video"&gt;
&lt;video src="https://balyberdin.com/library/video/en_exp-text_02_@loop.mp4#t=0.001" width="1280" height="560" autoplay muted loop playsinline alt="" /&gt;

&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Auto-resize the shape layer bounding box to the text length.&lt;/p&gt;
&lt;p&gt;Create a rectangle shape and add a text layer above it.&lt;br /&gt;
Apply this expression to the &lt;f&gt;Size&lt;/f&gt; parameter of the shape layer:&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class="javascript"&gt;margin_width = 60;
margin_height = 40;

text_width = thisComp.layer(index-1).sourceRectAtTime().width;
text_height = thisComp.layer(index-1).sourceRectAtTime().height;

box_width = text_width + margin_width*2;
box_height = text_height + margin_height*2;

[box_width, box_height]&lt;/code&gt;&lt;/pre&gt;&lt;p class="foot"&gt;&lt;a href="https://creativecow.net/forums/thread/changing-shape-layers-size-width-due-to-text-width/"&gt;© Kalleheikki Kannisto&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For multi-line text, apply this additional expression to the &lt;f&gt;Position&lt;/f&gt; of the shape layer. This automatically aligns the shape’s position with the text.&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class="javascript"&gt;x = value[0];
y = content(&amp;quot;Rectangle 1&amp;quot;).content(&amp;quot;Rectangle Path 1&amp;quot;).size[1]/2;
[x,y]&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Animated Wiggle&lt;/h2&gt;
&lt;p&gt;Easily animate wiggle using two sliders: one controls the frequency, and the other controls the amplitude. For the best results, animate only amplitude.&lt;/p&gt;
&lt;p&gt;Add two &lt;f&gt;Slider Controls&lt;/f&gt; to the layer and apply this expression:&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class="javascript"&gt;w_freq = effect(&amp;quot;Slider Control&amp;quot;)(&amp;quot;Slider&amp;quot;);
w_amplitude = effect(&amp;quot;Slider Control 2&amp;quot;)(&amp;quot;Slider&amp;quot;);

wiggle(w_freq,w_amplitude)&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Looping Wiggle&lt;/h2&gt;
&lt;p&gt;With this expression, wiggle starts and ends at the same point.&lt;/p&gt;
&lt;p&gt;If it doesn’t loop correctly, it’s likely because the loop time is too short for wiggle to return to the starting point. Just increase &lt;f&gt;loopTime&lt;/f&gt; or &lt;f&gt;freq&lt;/f&gt;.&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class="javascript"&gt;freq = 1;
amp = 65;

startTime = 0; // Loop start time
loopTime = 3; // Loop duration in seconds

t = (time+startTime) % loopTime;
wiggle1 = wiggle(freq, amp, 1, 0.5, t);
wiggle2 = wiggle(freq, amp, 1, 0.5, t - loopTime);

linear(t, 0, loopTime, wiggle1, wiggle2)&lt;/code&gt;&lt;/pre&gt;&lt;p class="foot"&gt;&lt;a href="http://www.motionscript.com/design-guide/looping-wiggle.html"&gt;© Dan Ebberts&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Pin Shape Layer to One Side&lt;/h2&gt;
&lt;div class="half-video"&gt;&lt;div class="e2-text-video"&gt;
&lt;video src="https://balyberdin.com/library/video/en_exp_size-2_02_@loop.mp4#t=0.001" width="1280" height="560" autoplay muted loop playsinline alt="" /&gt;

&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Keep one of the shape’s sides fixed while adjusting the &lt;f&gt;Size&lt;/f&gt;.&lt;/p&gt;
&lt;p&gt;Apply this expression to the &lt;f&gt;Position&lt;/f&gt; of a shape layer:&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class="javascript"&gt;pinTo = &amp;quot;left&amp;quot;; // top, bottom, right or left
chosenShape = content(&amp;quot;Rectangle 1&amp;quot;).content(&amp;quot;Rectangle Path 1&amp;quot;);

if (pinTo == &amp;quot;top&amp;quot;){
     x = chosenShape.position[0];
     y = chosenShape.position[1]+chosenShape.size[1]/2;
}

else if (pinTo == &amp;quot;bottom&amp;quot;){
     x = chosenShape.position[0];
     y = chosenShape.position[1]-chosenShape.size[1]/2;
}

else if (pinTo == &amp;quot;right&amp;quot;){
     x = chosenShape.position[0]-chosenShape.size[0]/2
     y = chosenShape.position[1]
}

else if (pinTo == &amp;quot;left&amp;quot;){
     x = chosenShape.position[0]+chosenShape.size[0]/2;
     y = chosenShape.position[1]
}

[x,y]&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Rolling Circle and Square Rig&lt;/h2&gt;
&lt;div class="half-video"&gt;&lt;div class="e2-text-video"&gt;
&lt;video src="https://balyberdin.com/library/video/en_exp_rolling_rig_02_@loop.mp4#t=0.001" width="1280" height="560" autoplay muted loop playsinline alt="" /&gt;

&lt;/div&gt;
&lt;/div&gt;&lt;h3&gt;Rolling Circle&lt;/h3&gt;
&lt;p&gt;Apply this to the &lt;f&gt;Rotation&lt;/f&gt; and animate the &lt;f&gt;Position&lt;/f&gt;:&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class="javascript"&gt;transform.position[0]-(content(&amp;quot;Ellipse 1&amp;quot;).content(&amp;quot;Ellipse Path 1&amp;quot;).size[0]/2)-transform.position[0]/2&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;Rolling Square&lt;/h3&gt;
&lt;p&gt;This expression works with shapes, layers and compositions.&lt;/p&gt;
&lt;p&gt;Apply the expression to the &lt;f&gt;Position&lt;/f&gt;. Add a &lt;f&gt;Slider Control&lt;/f&gt; to the same layer. Animate the &lt;f&gt;Rotation&lt;/f&gt;. If the square doesn’t roll correctly, adjust the &lt;f&gt;Slider Control&lt;/f&gt;.&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class="javascript"&gt;targetLayer = thisLayer;
squareSize = targetLayer.sourceRectAtTime().width;
squareDiag = (Math.sqrt(2)*squareSize)/2/3.5;

try{
    squareOffset = effect(&amp;quot;Slider Control&amp;quot;)(&amp;quot;Slider&amp;quot;);
}

catch(err) {
    squareOffset = 0;
}


rot=transform.rotation;
scl=transform.scale[0]/100;
w=(squareSize/2)*scl;
r=(degreesToRadians(rot))*2;
t=transform.position;

[t[0]+w*rot/45,t[1]-(Math.abs((squareDiag+squareOffset)*Math.sin(r)))*scl];&lt;/code&gt;&lt;/pre&gt;&lt;p class="foot"&gt;&lt;a href="https://youtu.be/sVg8jnajLSk"&gt;Based on Mikey Borup’s expression&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Stepped Rotation&lt;/h2&gt;
&lt;div class="half-video"&gt;&lt;div class="e2-text-video"&gt;
&lt;video src="https://balyberdin.com/library/video/en_exp_rotator_03_@loop.mp4#t=0.001" width="1280" height="670" autoplay muted loop playsinline alt="" /&gt;

&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;An alternative to &lt;f&gt;time*n&lt;/f&gt;. Instead of a smooth rotation, it creates a stepped movement. I usually use it to animate clock hands, gears or other similar mechanisms.&lt;/p&gt;
&lt;p&gt;Apply to the &lt;f&gt;Rotation&lt;/f&gt;:&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class="javascript"&gt;angle = 15; // Rotation angle per second
rotateDuration = 10; // Duration of rotation in frames

rotateDurationFr = rotateDuration/(1/thisComp.frameDuration);

wholeSecond = Math.floor(time);
startAngle = wholeSecond * angle;
ease(time, wholeSecond, wholeSecond + rotateDurationFr, startAngle, startAngle + angle)&lt;/code&gt;&lt;/pre&gt;&lt;p class="foot"&gt;&lt;a href="https://creativecow.net/forums/thread/clock-second-hand-ticking/"&gt;© Xinlai Ni&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Advanced Stepped Rotation&lt;/h2&gt;
&lt;p&gt;A more customizable version of the stepped rotation expression.&lt;/p&gt;
&lt;p&gt;Apply to the &lt;f&gt;Rotation&lt;/f&gt;:&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class="javascript"&gt;angle = 15; // Rotation angle per second
rotateDuration = 6; // Duration of rotation in frames
timeStop = 5; // Stop duration between rotations
offset = 0; // Offset of the initial frame 

fr = timeToFrames(time)+offset;

cycle = timeStop+rotateDuration;
n = Math.floor(fr/cycle);
cur_phase = fr-n*cycle;

if((cur_phase)&amp;gt;timeStop){
angle*n+(cur_phase-timeStop)*angle/rotateDuration;
}
else{
angle*n;
}&lt;/code&gt;&lt;/pre&gt;&lt;p class="foot"&gt;&lt;a href="https://aexpressions.ru/expressions/circular/analogue-clock/"&gt;© aexpressions&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Maintain Scale When Parented&lt;/h2&gt;
&lt;div class="half-video"&gt;&lt;div class="e2-text-video"&gt;
&lt;video src="https://balyberdin.com/library/video/en_exp_maintain-scale_02_@loop.mp4#t=0.001" width="1280" height="670" autoplay muted loop playsinline alt="" /&gt;

&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;When you parent one object to another and scale the parent, both layers will scale. This expression prevents the child layer from scaling and only moves it by position.&lt;/p&gt;
&lt;p&gt;Apply to the layer’s &lt;f&gt;Scale&lt;/f&gt;, which should have a constant size:&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class="javascript"&gt;s = [];
ps = parent.transform.scale.value;
for (i = 0; i &amp;lt; ps.length; i++){
s[i] = value[i]*100/ps[i];
}
s&lt;/code&gt;&lt;/pre&gt;&lt;p class="foot"&gt;&lt;a href="https://docs.google.com/spreadsheets/d/1a3ArTUHAJwVi-ObZofvz6IfrKbSGSENlaTIRTs8pAJU/edit?pageId=116871612094468624414#gid=0"&gt;© JR Canest&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Checkbox Switcher&lt;/h2&gt;
&lt;div class="half-video"&gt;&lt;div class="e2-text-video"&gt;
&lt;video src="https://balyberdin.com/library/video/en_exp_switcher_02_@loop.mp4#t=0.001" width="1020" height="490" autoplay muted loop playsinline alt="" /&gt;

&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Toggle any value with a checkbox.&lt;/p&gt;
&lt;p&gt;Add a &lt;f&gt;Checkbox Control&lt;/f&gt; to the layer with the expression.&lt;br /&gt;
Apply this expression to a parameter you want to control:&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class="javascript"&gt;if (effect(&amp;quot;Checkbox Control&amp;quot;)(1) == 0) 0 else 100&lt;/code&gt;&lt;/pre&gt;&lt;h2&gt;Shape Layer Loop&lt;/h2&gt;
&lt;p&gt;Standard &lt;f&gt;loopOut()&lt;/f&gt; doesn’t work with shape layers, but this expression does.&lt;/p&gt;
&lt;p&gt;Apply to the &lt;f&gt;Path&lt;/f&gt; of the shape layer:&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class="javascript"&gt;try{
pingPong = false; // Set to true if pingPong is needed

timeStart = thisProperty.key(1).time;
duration = thisProperty.key(thisProperty.numKeys).time-timeStart;
quant=Math.floor((time-timeStart)/duration);

if(quant&amp;lt;0) quant = 0

if(quant%2 == 1 &amp;amp;&amp;amp; pingPong == true){
t = 2*timeStart+ (quant+1)*duration - time;
}

else{
t = time-quant*duration;
}
}
catch(err){
t = time;
}
thisProperty.valueAtTime(t)&lt;/code&gt;&lt;/pre&gt;&lt;p class="foot"&gt;&lt;a href="https://aexpressions.ru/expressions/loop/loopout-path-ping-pong/"&gt;© aexpressions&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Range Mapper&lt;/h2&gt;
&lt;div class="half-video"&gt;&lt;div class="e2-text-video"&gt;
&lt;video src="https://balyberdin.com/library/video/en_exp_range-mapper_03_@loop.mp4#t=0.001" width="1150" height="560" autoplay muted loop playsinline alt="" /&gt;

&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Remap input values to a different output range.&lt;/p&gt;
&lt;p&gt;Add a &lt;f&gt;Slider Control&lt;/f&gt; to a layer with expression and apply this to any parameter:&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class="javascript"&gt;input = effect(&amp;quot;Slider Control&amp;quot;)(&amp;quot;Slider&amp;quot;);

inputLow = 0;
inputHigh = 100;
outputLow = 450;
outputHigh = 650;

linear(input,inputLow,inputHigh,outputLow,outputHigh)&lt;/code&gt;&lt;/pre&gt;&lt;p class="foot"&gt;&lt;a href="https://creativecow.net/forums/thread/range-mapping-expression/"&gt;© Dan Ebberts&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Maintain Stroke Width When Scaling&lt;/h2&gt;
&lt;div class="half-video"&gt;&lt;div class="e2-text-video"&gt;
&lt;video src="https://balyberdin.com/library/video/en_exp_stroke-scale_02_@loop.mp4#t=0.001" width="1280" height="670" autoplay muted loop playsinline alt="" /&gt;

&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Keep a constant stroke width when scaling a shape.&lt;/p&gt;
&lt;p&gt;Apply this to the &lt;f&gt;Stroke Width&lt;/f&gt; of the shape layer:&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class="javascript"&gt;value / length(toComp([0,0]), toComp([0.7071,0.7071])) || 0.001;&lt;/code&gt;&lt;/pre&gt;&lt;p class="foot"&gt;&lt;a href="https://battleaxe.tumblr.com/post/101945073972/maintain-stroke-weight-expression"&gt;© Adam Plouff&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Counters&lt;/h2&gt;
&lt;p&gt;A collection of 6 counter expressions for various use cases. All of these counters are basically text layers linked to slider controls, which can be keyframed.&lt;/p&gt;
&lt;h3&gt;1. Simple Counter&lt;/h3&gt;
&lt;div class="quarter-video"&gt;&lt;div class="e2-text-video"&gt;
&lt;video src="https://balyberdin.com/library/video/en_exp-counter_simple_03_@loop.mp4#t=0.001" width="700" height="140" autoplay muted loop playsinline alt="" /&gt;

&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Displays numbers with a fixed decimal place.&lt;/p&gt;
&lt;p&gt;Add a &lt;f&gt;Slider Control&lt;/f&gt; to your text layer, it will control the counter. Apply expression to the &lt;f&gt;Source Text&lt;/f&gt;. Change the number of decimal places by adjusting the &lt;f&gt;toFixed(2)&lt;/f&gt; parameter.&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class="javascript"&gt;parseFloat(effect(&amp;quot;Slider Control&amp;quot;)(&amp;quot;Slider&amp;quot;)).toFixed(2)&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;2. Comma Separator Counter&lt;/h3&gt;
&lt;div class="quarter-video"&gt;&lt;div class="e2-text-video"&gt;
&lt;video src="https://balyberdin.com/library/video/en_exp-counter_comma_03_@loop.mp4#t=0.001" width="700" height="140" autoplay muted loop playsinline alt="" /&gt;

&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Replaces the decimal point with a comma. If you happen to need a similar setup with more customization, it’s &lt;a href="http://keyframed.tv/how-to-format-a-slider-control-value-as-money-in-after-effects/"&gt;right here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Add a &lt;f&gt;Slider Control&lt;/f&gt; and apply expression to the &lt;f&gt;Source Text&lt;/f&gt;.&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class="javascript"&gt;c = parseFloat(effect(&amp;quot;Slider Control&amp;quot;)(&amp;quot;Slider&amp;quot;)).toFixed(2);
c.toString().replace(&amp;quot;.&amp;quot;, &amp;quot;,&amp;quot;)&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;3. Counter with Additional Symbols&lt;/h3&gt;
&lt;div class="quarter-video"&gt;&lt;div class="e2-text-video"&gt;
&lt;video src="https://balyberdin.com/library/video/en_exp-counter_symbols_03_@loop.mp4#t=0.001" width="700" height="140" autoplay muted loop playsinline alt="" /&gt;

&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Adds symbols like &lt;f&gt;+&lt;/f&gt; or &lt;f&gt;%&lt;/f&gt; to the number.&lt;/p&gt;
&lt;p&gt;Add a &lt;f&gt;Slider Control&lt;/f&gt; and apply expression to the &lt;f&gt;Source Text&lt;/f&gt;.&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class="javascript"&gt;&amp;quot;+&amp;quot;+parseFloat(effect(&amp;quot;Slider Control&amp;quot;)(&amp;quot;Slider&amp;quot;)).toFixed(2)+&amp;quot;%&amp;quot;&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;4. Counter with Leading Zeros&lt;/h3&gt;
&lt;div class="quarter-video"&gt;&lt;div class="e2-text-video"&gt;
&lt;video src="https://balyberdin.com/library/video/en_exp-counter_zeros_03_@loop.mp4#t=0.001" width="700" height="140" autoplay muted loop playsinline alt="" /&gt;

&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Displays numbers like &lt;f&gt;001&lt;/f&gt; instead of &lt;f&gt;1&lt;/f&gt;.&lt;/p&gt;
&lt;p&gt;Add a &lt;f&gt;Slider Control&lt;/f&gt; and apply expression to the &lt;f&gt;Source Text&lt;/f&gt;.&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class="javascript"&gt;zerosAmount = 3;

var slider = effect(&amp;quot;Slider Control&amp;quot;)(&amp;quot;Slider&amp;quot;);

function padStart(string, targetLength, character) {
string = (string instanceof String) ? string : string.toString();
targetLength = targetLength &amp;gt;&amp;gt; 0;
character = character || ' ';

while (string.length &amp;lt; targetLength) {
string = character + string;
}

return string;
};

if (slider &amp;gt;= 0) {
zeroAmount = zerosAmount + 1;
paddedString = padStart(parseFloat(slider.value).toFixed(0), zerosAmount, '0');
}

else {
paddedString = '-0'+padStart(parseFloat(slider.value).toFixed(0)*-1, zerosAmount, '0');
}

paddedString;&lt;/code&gt;&lt;/pre&gt;&lt;p class="foot"&gt;&lt;a href="https://community.adobe.com/t5/after-effects/how-to-create-a-counting-number-but-starting-with-zeros/td-p/10632356"&gt;Based on Tomas Sinkunas’ expression&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;5. Digit Grouping Counter&lt;/h3&gt;
&lt;div class="quarter-video"&gt;&lt;div class="e2-text-video"&gt;
&lt;video src="https://balyberdin.com/library/video/en_exp-counter_grouping_03_@loop.mp4#t=0.001" width="700" height="140" autoplay muted loop playsinline alt="" /&gt;

&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;Adds spacing to group digits, turning &lt;f&gt;30000&lt;/f&gt; into &lt;f&gt;30 000&lt;/f&gt;.&lt;/p&gt;
&lt;p&gt;Add a &lt;f&gt;Slider Control&lt;/f&gt; and apply expression to the &lt;f&gt;Source Text&lt;/f&gt;.&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class="javascript"&gt;num = parseFloat(effect(&amp;quot;Slider Control&amp;quot;)(&amp;quot;Slider&amp;quot;)).toFixed(0);
str = isNaN(num) ? &amp;quot;&amp;quot; : (num * 1 + &amp;quot;&amp;quot;);
str.replace(/(\d)(?=(\d\d\d)+([^\d]|$))/g, '$1 ');&lt;/code&gt;&lt;/pre&gt;&lt;p class="foot"&gt;&lt;a href="https://creativecow.net/forums/thread/number-expression-with-decimals/"&gt;© Tomas Bumbulevičius&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;6. Large Number Counter:&lt;/h3&gt;
&lt;div class="quarter-video"&gt;&lt;div class="e2-text-video"&gt;
&lt;video src="https://balyberdin.com/library/video/en_exp-counter_large_03_@loop.mp4#t=0.001" width="700" height="140" autoplay muted loop playsinline alt="" /&gt;

&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;For values above 1,000,000, use &lt;f&gt;Angle Control&lt;/f&gt; instead of a &lt;f&gt;Slider Control&lt;/f&gt;.&lt;/p&gt;
&lt;p&gt;Add an &lt;f&gt;Angle Control&lt;/f&gt; and apply expression to the &lt;f&gt;Source Text&lt;/f&gt;.&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class="javascript"&gt;number = Math.round(effect(&amp;quot;Angle Control&amp;quot;)(&amp;quot;Angle&amp;quot;)/360);

n=&amp;quot;&amp;quot; + number;
s=&amp;quot;&amp;quot;;
for(i=0, l=n.length; i&amp;amp;#60;l;  i++){
    if(s &amp;amp;&amp;amp; s!=&amp;quot;-&amp;quot; &amp;amp;&amp;amp; (l-i)%3 ==0)
                s+=&amp;quot; &amp;quot;; 
        s += n[i];
}
s;&lt;/code&gt;&lt;/pre&gt;&lt;p class="foot"&gt;&lt;a href="https://chunkmotion.design/resources/after-effects-expressions/"&gt;© Chunk Motion&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Various Mini Expressions&lt;/h2&gt;
&lt;p&gt;And finally, 4 useful mini-expressions that often come in handy.&lt;/p&gt;
&lt;h3&gt;1. Link to Layer Above or Below&lt;/h3&gt;
&lt;div class="half-video"&gt;&lt;div class="e2-text-video"&gt;
&lt;video src="https://balyberdin.com/library/video/en_exp-index-1_02_@loop.mp4#t=0.001" width="900" height="560" autoplay muted loop playsinline alt="" /&gt;

&lt;/div&gt;
&lt;/div&gt;&lt;p&gt;It’s not a complete expression, but only part of it. Instead of linking one layer to another using its name, it is sometimes more convenient to link to a layer above or below the layer with the expression.&lt;/p&gt;
&lt;p&gt;In the example, I link the box’s layer position to any layer above. To parent to a layer below instead, use &lt;f&gt;index+1&lt;/f&gt;.&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class="javascript"&gt;thisComp.layer(index-1)&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;2. Constantly Accelerating Rotation&lt;/h3&gt;
&lt;p&gt;Add this to &lt;f&gt;Rotation&lt;/f&gt; for progressively faster spins:&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class=""&gt;time*time*time*time&lt;/code&gt;&lt;/pre&gt;&lt;h3&gt;3. Keyframes with &lt;f&gt;time*n&lt;/f&gt;&lt;/h3&gt;
&lt;p&gt;Add constant motion while still allowing keyframes.&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class="javascript"&gt;value+time*11&lt;/code&gt;&lt;/pre&gt;&lt;p class="foot"&gt;&lt;a href="https://youtu.be/rsW4fwscwKI?t=193"&gt;© Ben Marriott&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;4. Link Gradient Ramp to Layer&lt;/h3&gt;
&lt;p&gt;Prevent a gradient ramp from shifting when moving the layer. Apply to the &lt;f&gt;Start&lt;/f&gt; and &lt;f&gt;End&lt;/f&gt; of the gradient.&lt;/p&gt;
&lt;pre class="e2-text-code"&gt;&lt;code class="javascript"&gt;toComp(value)&lt;/code&gt;&lt;/pre&gt;&lt;p class="foot"&gt;&lt;a href="https://aexpressions.ru/expressions/misc/link-ramp-to-layer/"&gt;© aeexpressions&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;br&gt;&lt;/p&gt;
&lt;p&gt;That’s it! This collection includes 23 expressions I use regularly.&lt;br /&gt;
&lt;a href="https://balyberdin.gumroad.com/l/ae-expressions"&gt;📁 The project file&lt;/a&gt; with all of them is available for free.&lt;/p&gt;
</description>
</item>


</channel>
</rss>