Code wiggler

Community Beginner ,
Sep 08, 2022 Sep 08, 2022

Copy link to clipboard

Copied

Hi guys, I am trying to recreate the wiggler function (which you can find window - wiggler) to add some more features to it, but I cannot wrap my head around the math behind it. Can anyone advise in what direction should I be looking?

TOPICS
Scripting , SDK

Views

64

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 09, 2022 Sep 09, 2022

Copy link to clipboard

Copied

You would need to be much more specific and explain what you are actually struggling with. The wiggle() stuff is simply a 3D Perlin noise whose parameters you manipulate and that's it.

 

Mylenium

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 10, 2022 Sep 10, 2022

Copy link to clipboard

Copied

My final goal is to create a script that will have the same functions as the after effects’ builtin wiggler plugin (window - wiggler), but I want to add some more features to it, like storing wiggler’s settings to presets to quickly apply it later.

So to recreate it I am trying to understand the math behind the effect.  The plugin divides every second between 2 keyframes to N(Frequency parameter) time ranges and between each of the ranges the property’s value goes from 0 to up to Magnitude value following some type of sinusoidal path. For example between 2 position keyframes: first is at the 0 seconds and position 100, 540 and the second is at the 1st second and again at position 100, 540; I apply wiggler with freq = 10 and Mag = 20px every frame the values will go:


x: 100.00 y: 540.00

x: 109.87 y: 553.37

x: 105.15 y: 549.39

x: 101.56 y: 546.38

x: 92.75 y: 541.25

x: 98.66 y: 547.14

x: 109.84 y: 561.73

x: 112.47 y: 554.50

x: 114.51 y: 548.13

x: 118.88 y: 539.86

x: 115.24 y: 535.69

x: 108.82 y: 534.84

x: 113.02 y: 533.21

x: 111.50 y: 522.73

x: 94.42 y: 520.88

x: 90.61 y: 525.99

x: 78.58 y: 538.05

x: 86.86 y: 536.36

x: 97.61 y: 545.02

x: 103.10 y: 559.63

x: 107.31 y: 556.57

x: 108.77 y: 555.00

x: 117.19 y: 559.23

x: 124.37 y: 553.85

Yes, this looks like Perlin noise combined with sinusoid values, but I want somehow recreate the exact formula. There is also a “jagged” noise type, which I have no idea what it is

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 10, 2022 Sep 10, 2022

Copy link to clipboard

Copied

I forget to attach some screenshots to better understand the examples

Screenshot 2022-09-10 at 20.58.29.png

Screenshot 2022-09-10 at 20.58.24.png

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 10, 2022 Sep 10, 2022

Copy link to clipboard

Copied

LATEST

I think this is a pretty ambitious project, but if you're determined to try it, I think you need to gather a lot more data. I think a Perlin noise field is used to determine the intermediate keyframe values, but I think you also need to analyze what's going on with the randomization of the spatial tangents and temporal ease. If I was doing it, I'd write a little script to dump that data to see if I could figure out if it's just some random function or if it also uses a Perlin noise field for those values. I don't think you'll be able to match the algorithm exactly, but with enough careful analysis you might get close.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 09, 2022 Sep 09, 2022

Copy link to clipboard

Copied

There is not much match in the wiggle function? I works like this: wiggle(a, b), where a is the number of times you want your object to move per second and b is the value your object is allowed to move (both positive and negative) from the object's initial value.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 09, 2022 Sep 09, 2022

Copy link to clipboard

Copied

I meanr "math" not "match".

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Sep 10, 2022 Sep 10, 2022

Copy link to clipboard

Copied

I think you misunderstood the question, I am trying to figure out the exact formula of the wiggler effect. I know how the wiggler() expression works, it has 5 parameters: wiggle(freq, amp, octaves, amp_mult, time)

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 10, 2022 Sep 10, 2022

Copy link to clipboard

Copied

You may be defeating your own intentions by not calculating the actual noise based on time and slicing up the time beforehand. That would already quantize the result and produce a different look.As per your graphs you are also not handling the keyframe interpolation and the sub-harmonies/ sub-octaves, which kind of is the point why wiggle() sometimes looks as it does when a result gets sampled. Again, I think your pre-time-slicing is the biggest issue here.

 

Mylenium

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines