ΡΠ°ΠΉΠΌΠ΅Ρ after effects ΡΠΊΡΠΈΠΏΡ
ΠΠΎΠ»Π΅Π·Π½ΡΠ΅ Π²ΡΡΠ°ΠΆΠ΅Π½ΠΈΡ (Expression) Π² After Effects
ΠΠΎΠ»Π΅Π·Π½ΡΠ΅ Π²ΡΡΠ°ΠΆΠ΅Π½ΠΈΡ (Expression) Π² After Effects.
ΠΡΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ (Expression) AutoFade Π² After Effects (ΠΏΡΠΈΠΌΠ΅Π½ΡΠ΅ΠΌ ΠΊ opacity)
ΠΡΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ (Expression) Π΄Π»Ρ ΡΠ°ΠΉΠΌΠ΅ΡΠ° ΠΎΠ±ΡΠ°ΡΠ½ΠΎΠ³ΠΎ ΠΎΡΡΡΠ΅ΡΠ° Π² After Effects (ΠΏΡΠΈΠΌΠ΅Π½ΡΠ΅ΠΌ ΠΊ Source Text)
ΠΡΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ (Expression) Π·Π°ΡΡΡ Π°ΡΡΠΈΡ ΠΊΠΎΠ»Π΅Π±Π°Π½ΠΈΠΉ Π² After Effects
ΠΡΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ (Expression) Π² After Effects Π΄Π»Ρ Time Remap
ΠΡΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ (Expression) Π² After Effects Π΄Π»Ρ Π²ΡΠ°ΡΠ΅Π½ΠΈΡ Ρ ΠΏΠΎΡΡΠΎΡΠ½Π½ΠΎΠΉ ΡΠΊΠΎΡΠΎΡΡΡΡ Π±Π΅Π· ΠΊΠ»ΡΡΠ΅Π²ΡΡ
ΠΊΠ°Π΄ΡΠΎΠ²
ΠΡΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ (Expression) Π² After Effects Π΄Π»Ρ Π΄Π²ΠΈΠΆΠ΅Π½ΠΈΡ ΠΏΠΎ ΡΠΏΠΈΡΠ°Π»ΠΈ (ΠΏΡΠΈΠΌΠ΅Π½ΡΠ΅ΠΌ Π½Π° position)
ΠΡΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ (Expression) Π² After Effects Π΄Π»Ρ ΠΏΠ΅ΡΠ΅ΠΌΡΠ΅Π½ΠΈΡ Ρ ΠΏΠΎΡΡΠΎΡΠ½Π½ΠΎΠΉ ΡΠΊΠΎΡΠΎΡΡΡΡ Π±Π΅Π· ΠΊΠ»ΡΡΠ΅Π²ΡΡ ΠΊΠ°Π΄ΡΠΎΠ²
ΠΡΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ (Expression) Wiggle Π² After Effects
Wiggle Π²ΡΡΠ°ΠΆΠ΅Π½ΠΈΡ Ρ Π°ΠΎΡΠΈΡΠ½ΠΎΠ³ΠΎ ΠΈΠ·ΠΌΠ΅Π½Π΅Π½ΠΈΡ Π·Π½Π°ΡΠ΅Π½ΠΈΡ. ΠΡΠΎ Π²ΡΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ ΠΌΠΎΠΆΠ΅Ρ ΠΈΡΠΏΠΎΠ»ΡΠ·ΠΎΠ²Π°ΡΡΡΡ, ΡΡΠΎΠ±Ρ ΡΠ΄Π΅Π»Π°ΡΡ Π²Π°ΡΡ ΡΡΠ΅Π½Ρ Π±ΠΎΠ»Π΅Π΅ ΠΎΡΠ³Π°Π½ΠΈΡΠ½ΠΎΠΉ ΠΈ Π΅ΡΡΠ΅ΡΡΠ²Π΅Π½Π½ΠΎΠΉ.
ΠΠ΅ΡΠ²Π°Ρ ΡΠΈΡΡΠ° β ΠΊΠΎΠ»ΠΈΡΠ΅ΡΡΠ²ΠΎ ΡΠ΄Π²ΠΈΠ³ΠΎΠ² Π² ΡΠ΅ΠΊΡΠ½Π΄Ρ, Π° Π²ΡΠΎΡΠΎΠ΅ ΡΠΈΡΠ»ΠΎ β Π·Π½Π°ΡΠ΅Π½ΠΈΠ΅ ΠΏΠΎΠΊΠ°ΡΠΈΠ²Π°Π½ΠΈΡ.
ΠΡΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ (Expression) Time Π² After Effects
ΠΡΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ Time ΠΈΠ΄Π΅Π°Π»ΡΠ½ΠΎ ΠΏΠΎΠ΄Ρ ΠΎΠ΄ΠΈΡ Π΄Π»Ρ ΠΎΠ±ΡΠ΅ΠΊΡΠΎΠ² Ρ Π±Π΅ΡΠΊΠΎΠ½Π΅ΡΠ½ΡΠΌ Π΄Π²ΠΈΠΆΠ΅Π½ΠΈΠ΅ΠΌ. ΠΠ°ΠΏΡΠΈΠΌΠ΅Ρ, Π΅ΡΠ»ΠΈ Π²Ρ Ρ ΠΎΡΠΈΡΠ΅, ΡΡΠΎΠ±Ρ ΠΎΠ±ΡΠ΅ΠΊΡ Π²ΡΠ°ΡΠ°Π»ΡΡ Π±Π΅ΡΠΊΠΎΠ½Π΅ΡΠ½ΠΎ, Π²Ρ ΠΌΠΎΠΆΠ΅ΡΠ΅ ΠΏΡΠΎΡΡΠΎ Π΄ΠΎΠ±Π°Π²ΠΈΡΡ ΡΠ»ΠΎΠ²ΠΎ time Π² ΠΊΠ°ΡΠ΅ΡΡΠ²Π΅ ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡΠ° Π²ΡΠ°ΡΠ΅Π½ΠΈΡ, ΠΈ Π²Π°Ρ ΠΎΠ±ΡΠ΅ΠΊΡ Π±ΡΠ΄Π΅Ρ Π²ΡΠ°ΡΠ°ΡΡΡΡ Π½Π° 1 Π³ΡΠ°Π΄ΡΡ Π½Π° Π΄Π»ΠΈΠ½Π΅ Π²ΡΠ΅ΠΉ ΠΊΠΎΠΌΠΏΠΎΠ·ΠΈΡΠΈΠΈ. ΠΠ°ΡΠ°ΠΌΠ΅ΡΡ Π²ΡΠ΅ΠΌΠ΅Π½ΠΈ ΡΠ°ΠΊΠΆΠ΅ ΡΠ°Π±ΠΎΡΠ°Π΅Ρ Ρ ΠΎΡΠ½ΠΎΠ²Π½ΡΠΌΠΈ ΠΌΠ°ΡΠ΅ΠΌΠ°ΡΠΈΡΠ΅ΡΠΊΠΈΠΌΠΈ ΡΡΠ°Π²Π½Π΅Π½ΠΈΡΠΌΠΈ, ΠΏΠΎΡΡΠΎΠΌΡ Π΅ΡΠ»ΠΈ Π²Ρ Ρ ΠΎΡΠΈΡΠ΅, ΡΡΠΎΠ±Ρ ΡΠ»ΠΎΠΉ Π²ΡΠ°ΡΠ°Π»ΡΡ Π² 30 ΡΠ°Π· Π±ΡΡΡΡΠ΅Π΅, Π²Ρ ΠΌΠΎΠΆΠ΅ΡΠ΅ ΠΏΡΠΎΡΡΠΎ Π½Π°ΠΏΠΈΡΠ°ΡΡ Π²ΡΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ time*30.
ΠΡΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ (Expression) loopOut Π² After Effects Π΄Π»Ρ ΡΠΈΠΊΠ»ΠΈΡΠ½ΠΎΠΉ Π°Π½ΠΈΠΌΠ°ΡΠΈΠΈ
Π¦ΠΈΠΊΠ»ΠΈΡΠ½Π°Ρ Π°Π½ΠΈΠΌΠ°ΡΠΈΡ. ΠΡΡΠ°ΠΆΠ΅Π½ΠΈΡ loopOut() ΡΡΠ΅Π±ΡΠ΅ΡΡΡ Π½Π°Π»ΠΈΡΠΈΡ ΠΊΠ»ΡΡΠ΅Π²ΡΡ ΠΊΠ°Π΄ΡΠΎΠ². Π’Π°ΠΊ ΡΡΠΎ Π΅ΡΠ»ΠΈ Ρ Π²Π°Ρ Π΅ΡΡΡ ΡΠ»ΠΎΠΉ, ΠΊΠΎΡΠΎΡΡΠΉ Π²ΡΠ°ΡΠ°Π΅ΡΡΡ ΠΏΠΎ ΠΊΡΡΠ³Ρ Π² ΡΠ΅ΡΠ΅Π½ΠΈΠ΅ 1 ΡΠ΅ΠΊΡΠ½Π΄Ρ, Π²Ρ ΠΌΠΎΠΆΠ΅ΡΠ΅ Π΄ΠΎΠ±Π°Π²ΠΈΡΡ Π²ΡΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ loopOut(), ΠΈ Π΄Π²ΠΈΠΆΠ΅Π½ΠΈΠ΅ Π±ΡΠ΄Π΅Ρ ΠΏΠΎΠ²ΡΠΎΡΡΡΡΡΡ Π·Π°ΡΠΈΠΊΠ»Π΅Π½ΠΎ.
ΠΡΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ (Expression) seedRandom Π² After Effects Π΄Π»Ρ ΡΠ°Π½Π΄ΠΎΠΌΠ° (ΡΠ»ΡΡΠ°ΠΉΠ½ΠΎΡΡΠΈ)
ΠΡΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ (Expression) Math.round Π² After Effects Π΄Π»Ρ ΡΠ°Π½Π΄ΠΎΠΌΠ° (ΡΠ»ΡΡΠ°ΠΉΠ½ΠΎΡΡΠΈ)
Math.round() β ΡΡΠΎ Π²ΡΡΠ°ΠΆΠ΅Π½ΠΈΠ΅, ΠΎΠΊΡΡΠ³Π»ΡΡΡΠ΅Π΅ Π΄Π΅ΡΡΡΠΈΡΠ½ΡΠ΅ ΡΠΈΡΠ»Π° Π΄ΠΎ Π±Π»ΠΈΠΆΠ°ΠΉΡΠ΅Π³ΠΎ ΡΠ΅Π»ΠΎΠ³ΠΎ ΡΠΈΡΠ»Π°. ΠΠ½ ΠΈΠ΄Π΅Π°Π»ΡΠ½ΠΎ ΠΏΠΎΠ΄Ρ ΠΎΠ΄ΠΈΡ Π΄Π»Ρ Π²ΡΠΏΠΎΠ»Π½Π΅Π½ΠΈΡ ΠΎΠ±ΡΠ°ΡΠ½ΡΡ ΠΎΡΡΡΠ΅ΡΠΎΠ² ΠΈΠ»ΠΈ ΡΠΈΡΡ Π² ΠΈΡΡ ΠΎΠ΄Π½ΠΎΠΌ ΡΠ΅ΠΊΡΡΠ΅. ΠΡΠΎΡΡΠΎ Π΄ΠΎΠ±Π°Π²ΡΡΠ΅ ΡΠ²ΠΎΠ΅ ΠΈΡΡ ΠΎΠ΄Π½ΠΎΠ΅ Π²ΡΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ Π² ΠΊΡΡΠ³Π»ΡΡ ΡΠΊΠΎΠ±ΠΊΡ Π²ΡΡΠ°ΠΆΠ΅Π½ΠΈΡ Math.round() Π² ΠΏΠΎΠ»Π΅ Π²ΡΡΠ°ΠΆΠ΅Π½ΠΈΡ source text, ΠΈ Π²ΡΠ΅ Π²Π°ΡΠΈ ΡΠΈΡΠ»Π° Π±ΡΠ΄ΡΡ ΠΎΠΊΡΡΠ³Π»Π΅Π½Ρ.
ΠΡΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ (Expression) Snap Zoom In/Out Π² After Effects
ΠΡΠΈΠΌΠ΅Π½ΡΠ΅ΠΌ Π½Π° ΡΠ΅ΠΊΡΡ. ΠΡΠΈΠΌΠ΅Π½ΡΠ΅ΠΌ Π½Π° Scale ΠΏΠ°ΡΠ°ΠΌΠ΅ΡΡ. ΠΡΠΎ Π²ΡΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ ΡΠΎΠ·Π΄Π°Π΅Ρ ΠΌΠ°ΡΡΡΠ°Π±ΠΈΡΠΎΠ²Π°Π½ΠΈΠ΅ ΡΠ»ΠΎΡ Π² Π½Π°ΡΠ°Π»Π΅ ΠΈ ΠΊΠΎΠ½ΡΠ΅ ΡΠ»ΠΎΡ.
ΠΡΠ»ΠΈ ΡΡ ΠΈΡΠΏΠΎΠ»ΡΠ·ΡΠ΅ΡΡ ΠΎΡΡ Z, ΡΠΎ ΠΏΡΠΈΠΌΠ΅Π½ΠΈ ΡΡΠΎ Π²ΡΡΠ°ΠΆΠ΅Π½ΠΈΠ΅
ΠΡΡΠ°ΠΆΠ΅Π½ΠΈΠ΅ (Expression) Y Axis Jitter Π² After Effects
Π‘ΠΎΠ·Π΄Π°Π΅Ρ ΡΠ»ΡΡΠ°ΠΉΠ½ΠΎΠ΅ Π½Π΅ΡΡΡΠΎΠΉΡΠΈΠ²ΠΎΠ΅ Π΄Π²ΠΈΠΆΠ΅Π½ΠΈΠ΅ ΠΏΠΎ ΠΎΡΠΈ Y. Π ΠΏΠ΅ΡΠ΅ΠΌΠ΅Π½Π½ΡΡ pos, ΠΏΠΈΡΠ΅ΠΌ Π·Π½Π°ΡΠ΅Π½ΠΈΡ Π΄Π»Ρ ΠΎΠΏΡΠ΅Π΄Π΅Π»Π΅Π½ΠΈΡ ΡΠΈΠ»Ρ Jitter.
Timer
This After Effects script creates a simple animated timer HH:MM:SS, with controllable speed and start time.
USAGE
Select a text layer.
Execute the script and adjust parameters.
Free material license
These scripts are copyrighted by Motion Boutique.
They are free for personal and commercial use but come βas isβ with no warranty nor any free personal support.
Redistribution in any form is not allowed, instead always link to www.motionboutique.com for correct files.
By downloading any of these scripts, you agree the above terms.
DOWNLOAD
Timer
MORE TOOL
Images Wall
TextBox
Paravent
ASCII Generator
Home of the creators of Newton for Adobe After Effects.
We are Motion Boutique
We carefully craft original tools for Adobe After Effects
«Kinetic typography experiment 02 by @lucabanchelli
Made with Newton»
.
📌Get our tools! Links in our bio!
.
#design #typography #motiongraphics #minimal #black #graphicdesign #artdirector #berlin #swissdesign #typography #typeface #lab #graphic #365typefaces #365tchallenge @36daysoftype #36daysoftype #36days_b #36days #aescripts
by @a_shpakovsay
#wakeup
📌Get our tools! Links in our bio!
«Stay safe wear a mask» by @khan_mubin
Using #newton3 for #aftereffects
📌Get our tools! Links in our bio!
#ae #aftereffects #animation #art #adobe #motion #mograph #motiondesign #newtonae
#aescripts #aetips #aeguru
#motiongraphics #motionlovers #motionographer #keyframes
#tutorial #motionaep #vector
by @amsterdmnd
ΠΠ»ΠΎΠΊΠ½ΠΎΡ Π΄Π»Ρ Π½Π΅ΡΠ²Π΅ΡΠ΅Π½Π½ΡΡ
Π² ΡΠ΅Π±Π΅ ΠΈΠ΄Π΅ΠΉ
.
try3
.
.
#aftereffects #newton3 #newton #motionaep #motiondesigner #motiongraphic #script #ae #supersila #motionboutique #aescripts #motion #vfx #tracking #panda #notepad #adobe #graphicdesign #animation #mograph #motiongraphics
by @brybruhh
Motion Tags: Blockchain HWY
Tag: ATH Warning
Tag: Hardware Wallet
.
.
.
#MotionTags #BlockchainHWY #thatmotionstudio #aftereffects #animation #motiongraphics #sounddesign #motiondesign #kinetictype #aescripts #newton3 #blockchain #defi #cryptoart #cryptosigns #trafficsigns #blockchainart #digitalcollectibles #signage #customsignage #warning #alltimehigh #ATH #⚠️
@aigaeyeondesign @themuseumofmodernart
.
.
.
.
.
.
.
.
#wolfgangweingart
#tdc #typedirectorsclub #aiga #aigaeyeondesign #moma
#buckuback #typegoodness #goodtype #type01 #contemporarytype #mgcollective #mdcommunity #motiondevotion #motionlovers #motiongraphics #motiondesign #motionmass #motionmate #motionaep #motionmob #motionaid #xuxoe #itsnicethat #damngoodmove #aescripts #graphicdesign #swissgraphic #behance #thedesigntip
AE Rig Series: Countdown Timer
Learn how to build a Countdown Timer rig in After Effects using expressions, or download our ready to run script.
Read more posts by this author.
In this tutorial we’ll construct a Timer rig that can be easily controlled using expression control effects.
Running the Timer script in AE.
Quick Reference
Below is the complete expression for quick reference and a walkthrough on how to set up the Timer object. For a code breakdown or to learn how to build it from scratch jump to the Building the Timer Rig section.
Setup
Create a new text layer in a new or existing comp and rename it to Timer (or whatever you choose).
Next create the following expression controls:
Finally, paste the expression below in the source text attribute of the text layer.
Building the Timer Rig
We’ll be building the rig from scratch so we can understand exactly what’s going on. We can then adapt this knowledge to customize our Timer further or to build similar items. Most of the methods used throughout this tutorial will come in very handy when building any other rigs.
Setup
Basic Timer Functions
Since we’ll be working with Time, it’s important to understand some basics. In After Effects, you can use the time method to get the current time in seconds.
This could do for a basic Timer, right? To turn it into a countdown Timer we can simply subtract the time method from a predefined value.
Simple Countdown Timer.
Count twice as fast.
Now for every second, our Timer will display double the value. Basically count twice as fast. To count twice as slow we can use:
Count twice as slow.
There are different types of controls that we will cover throughout the tutorial. For now let’s create a new Slider Control by heading over to the Effects Panel CMD/CTRL 5 and searching for it in the search box. Double click to apply the effect to the layer.
Note: Make sure to select the Timer layer before Double Clicking on the effect to apply it.
Referencing the Rate Slider. Control the Timer speed with the Rate Slider control.
Note: We could use a negative rate value to have the Timer count down but we’ll create a checkbox control for that instead, later on.
Limiting the Slider range.
Let’s move on to adding features to our Timer.
Setting a Start Time
An essential feature is the ability to specify a start time. Let’s add some new expression controls so we can define this in Hours, Minutes, and Seconds.
Add 3 new Slider controls and rename them to:
Now reference them in the Timer source text expression box.
Referencing the Start Time Sliders.
Since time in AE is returned in seconds, let’s convert the Hours and Minutes and sum them up so we have a total time in Seconds.
There are 60 seconds in 1 minute, and 3600 seconds in 1 hour, so we multiply the number of seconds in each unit by their value.
Converting time to seconds.
Now let’s add the sum to our current time.
Timer begins at predefined Start Time.
If you change the values of any of the three Start Time sliders you’ll see the text displaying the sum of those, plus the current time, in seconds.
Count Up or Count Down
Letβs add the option for the Timer to count up or down.
Now reference it in our expression.
Referencing the Countdown checkbox control.
Conditional Statements
If you are unfamiliar with conditional statements in programming, here is an example:
Conditional Statement structure.
We want to check whether our checkbox is on | 1 | true or off | 0 | false so we can simply pass it as a variable inside the brackets.
Conditional Statement example.
Conditional Statement for counting up or down.
Shorthand Conditional Statements
There is a shorter way of writing a conditional statement, using Conditional Ternary Operators and we can assign the outcome directly to the t variable.
Shorthand conditional implementation.
Finally, let’s have the Timer start at the layer’s in point, so we can move the layer around in the Timeline to define when the Timer will start counting. We can access a layer’s in point using layer.inPoint and simply inPoint if we are referring to the current layer.
Timer starts at layer’s inPoint.
Here is the snippet in context.
Timer with countdown feature.
Let’s move on to formatting, so we can control the way the time is displayed.
Formatting Time
Converting Seconds into Hours and Minutes
Note: A more detailed explanation of the modulus operator is featured here: The Modulus Operator in Detail.
So the operations, in order, are (with t being the total seconds):
Note: The Substring method substr() is used to cut characters from a string based on their position. Using substr(3) would cut everything after the third character starting from the beginning of the string. Using substr(-3) performs the same cut, but starting from the end of the string.
Using an Array to Store the Conversions
Let’s store these conversions in a single variable ( f ), by using an Array.
Storing conversions into Array.
If time is less than or equal to 0, cap all values to 0 (with padding). Else, store the time conversion operations we defined earlier. Paste the following snippet at the bottom of the expression.
Capping negative values at zero.
If you press play now, you will notice a bunch of rather long numbers separated by commas. We still need to round those numbers down! (except for Milliseconds since we dealt with those earlier using toFixed() and substr() ).
Rounding Numbers Down
For rounding down we’ll use the Math.floor() method as discussed previously in the Basic Timer Functions section.
We could write something like this:
Rounding each item in the array.
Looping through Array Items
Paste this snippet at the bottom of your expression. We now have our numbers nicely rounded to whole numbers.
Using a for loop to round each item in the array.
Join Array Items
Using join() to combine all elements in the array.
Zero Padding
The padStart() method pads the current string with another string (multiple times, if needed) until the resulting string reaches the given length. The padding is applied from the start of the current string. β MDN Web Docs.
Since padStart() requires a String we have to first convert our Numbers to Strings. Then we can use the padStart() method by specifying the length that the new String should be, and by what character it needs to be padded by. For our purpose we’ll specify a length of 2 and the «0» character (quoted, as we are working with Strings, remember!).
We need to apply this to all our items in our Time array. Let’s include this method in the for loop we setup earlier (appended to the rounding method Math.floor() ).
Padding each item in the array.
Padding Milliseconds with the correct length.
Toggling Milliseconds Visibility
We may want to toggle on or off the Milliseconds display. Let’s add a new Checkbox control to our Timer layer.
Referencing the Milliseconds checkbox control.
For the toggle to work we are going to use a method named pop() on our array. This will remove the last item of the array and, conveniently, our Milliseconds item is the last item of the array.
Popping the Milliseconds if the checkbox is off.
Time Format Dropdown Menu
In this section we are going to add the ability to choose between 3 time formats using the Dropdown Menu control.
Note: The dropdown menu control is a new feature in The After Effects 2020 (17.0) version. If you are running a previous version you may want to use a Checkbox control for each format to toggle between them.
Add a new Dropdown Menu control to the Timer layer. Rename it to Time Format and reference it in the expression.
Referencing the Time Format dropdown menu control.
Now head over to the Edit. button next to the new dropdown we created and edit the values to have:
Once set, we can start writing the logic for our control. We could easily use a conditional statement to check which option is selected in the dropdown.
Conditional statement for the format options.
But let’s use another way to achieve the same thing, that may be better suited for checking multiple cases: using a Switch Statement.
Switch Statements
Let’s look at the structure of a Switch Statement first.
The switch statement evaluates an expression, matching the expression’s value to a case clause, and executes statements associated with that case, as well as statements in cases that follow the matching case. β MDN Web Docs.
Slicing and Joining Arrays
Let’s implement slice() and join() for each case. Remember that the Milliseconds are handled by our checkbox control so we don’t have to deal with that here.
Here we just need to join the array since we are displaying all the items.
So to retrieve all items but the first 2 we simply pass 2 as the start range.
The Completed Switch Statement
Paste the following snippet at the bottom of the expression. Make sure there is a break statement at the bottom of each case, and we are good to go.
Switch statement for the Time format options.
Negative Time
Referencing the Negative Time checkbox control.
Prepending the minus sign to the current time.
Conclusion
Here is the final expression.
Completed Timer Rig expression.
This concludes the tutorial! Hopefully you now have a fully functioning Timer rig and a solid understanding of how it was built.