• Welcome to our Forum! Ask PC-Build Questions, discuss Tech-News, Content Creation & Gaming Workloads or get to know the CGDirector Community off-topic. Feel free to chime in with insight or questions on any existing topic too! :)

Question - Using the Wiggle Expression in After Effects – Ultimate Guide

D

Daniil

Guest
Hi everyone! (In TF2 soldier voice) Need some help here!

I just read this amazing article https://www.cgdirector.com/after-effects-wiggle-expression/ which I must say was a great help to me, understanding wiggle and how to have fun with it, but at this moment https://www.cgdirector.com/after-ef...iggle_using_Sliders_eg_Fade_Wiggle_in_and_out, when I thought I found my solution, I was stopped by my After Effects 2020, saying
error: syntax error: Invalid or unexpected token
Here is the expression I used from the article.

sliderTemp = effect(“Slider Control”)(“Slider”);
wiggleTemp=wiggle(sliderTemp,50);
[wiggleTemp[0], wiggleTemp[1], wiggleTemp[2]]


Can you help me, please?)
 
D

Daniil

Guest
sorry, wrong place for this thread! I can`t delete it, so please help with that(
 
Alex Glawion

Alex Glawion

CG Hardware Specialist @ CGDirector
Staff member
Joined
Jun 12, 2020
Messages
973
Reaction score
186
Points
43
There are three things you might have to adapt.

1. The last line of code outputs the wiggle in 3 dimensions. If you are using it 3D position (xyz), that's fine. Though if you are using it on a property that has just two or just one value, you'll have to adapt this.

For one value (e.g. just z-pos):
[wiggleTemp[0]]

For two values (e.g. scale x-y):
[wiggleTemp[0],wiggleTemp[1]]

2. You have to make sure your Effect and Slider names and the names used in the expression match. Other After Effects languages use differently named slider and effects names. If you are using an English AE, though, this doesn't have to be adapted.
-> be sure the effects is named Slider Control, and the slider is named Slider

3. Be sure your " quote characters are correctly copied. Sometimes copying stuff from the internet will convert your quotes into quotes that are not recognized by after effects. Easy fix: replace all quotes with the quotes you can write on your keyboard.

Here's what this expression should look like when it's passed correctly:


sliderTemp = effect("Slider Control")("Schieberegler");
wiggleTemp=wiggle(sliderTemp,50);
[wiggleTemp[0], wiggleTemp[1]];


I just tried copying it, and in fact, it's an issue with the quote marks. Will fix this in the article, thanks for letting me know! Seems like the browser shows slightly different quote marks that after effects doesn't like. You can just replace them with new quote marks within after effects to get it working right away.
 
Last edited:
Top