How to find the value of a variable quickly and easily.
When writing complex code, (such as Javascript expression in Adobe After Effects), it is often helpful to be able to see what a variable's value is. If you were using javascript in an HTML web page, you could send these values to the browser's Developer Console, using the simple code console.log(). Unfortunately, After Effects does not have the equivalent of a developer console. It does have the info panel, but you can only interact with that when writing a script. For a regular expression (or even an irregular one), I used to use a text layer and edit the sourceText to show the variable. But this was time consuming and not always easy - and quite often, it was confusing.
Instead, a much simpler approach is to throw an error. Using just the code below, the expression halts, After Effects highlights the issue and you can see the value of whatever you ask.
--------------------------------------------------------------------------------------
throw new Error( VARIABLE )
or even simpler, just:
throw VARIABLE
--------------------------------------------------------------------------------------
#AfterEffects #Expressions #tutorial
Get ShiveringCactus VFX as phone cases, T-shirts, mugs: https://www.redbubble.com/people/Shiv...
Or buy me a coffee: https://ko-fi.com/shiveringcactus
In the video, I mention that Dan Ebberts ( motionscript.com ) helped me adapt one of his expressions, you can download the preset from this list:
https://www.dropbox.com/s/26sadwh8aig...
To learn how to install presets (FFX files) check out this video: • How to install Plugins and Presets in...