Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Combining Two Wiggle Expressions

Community Beginner ,
Dec 27, 2022 Dec 27, 2022

First time on here, love the community. I'm working on a camera shake system of expressions and had a quick question about an issue that has been bugging me. I have two overall variables, flowy' shake and jolty' shake. I have them separated so I can have jolts at certain parts, and flow at other parts. I'm setting up wiggles for jolt and flow, but am struggling to combine the two. When simply adding the two wiggles with a plus sign, it is adding on top of the base layer value. I want the layer at the center of the comp and to add the wiggles on top. First time diving into expressions like this other than basic parenting and math.

Ement_0-1672129136359.pngexpand image

Ement_1-1672129158083.pngexpand image

 

TOPICS
Expressions , How to
912
Translate
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

correct answers 1 Correct answer

Community Beginner , Dec 27, 2022 Dec 27, 2022

Update! Using 'value=[X[0], Y[1]]-[thisComp.width/2, thisComp.height/2];' takes the default centered position of the layer by dividing the comp's length and width by 2 and subtracts it from the added wiggle expressions.

 

Entire string for anyone interested:

{
n=

//Jolt Amplitude
JRA=effect("Shake Controls")(2);
JXA=effect("Shake Controls")(3);
JYA=effect("Shake Controls")(4);

//Jolt Frequency
JRF=effect("Shake Controls")(6);
JXF=effect("Shake Controls")(7);
JYF=effect("Shake Controls")(8);

//Flow Amplitude
F

...
Translate
Community Beginner ,
Dec 27, 2022 Dec 27, 2022

Update! Using 'value=[X[0], Y[1]]-[thisComp.width/2, thisComp.height/2];' takes the default centered position of the layer by dividing the comp's length and width by 2 and subtracts it from the added wiggle expressions.

 

Entire string for anyone interested:

{
n=

//Jolt Amplitude
JRA=effect("Shake Controls")(2);
JXA=effect("Shake Controls")(3);
JYA=effect("Shake Controls")(4);

//Jolt Frequency
JRF=effect("Shake Controls")(6);
JXF=effect("Shake Controls")(7);
JYF=effect("Shake Controls")(8);

//Flow Amplitude
FRA=effect("Shake Controls")(12);
FXA=effect("Shake Controls")(13);
FYA=effect("Shake Controls")(14);

//Flow Frequency
FRF=effect("Shake Controls")(16);
FXF=effect("Shake Controls")(17);
FYF=effect("Shake Controls")(18);


[FRA, FXA, FYA];
[JRF, JXF, JYF];
[FRA, FXA, FYA];
[FRF, FXF, FYF];

//Phase
PX=effect("Shake Controls")(21);

[PX];

//Assembly
X=(wiggle(JXF, JXA, PX))+(wiggle(FXF, FXA, PX));
Y=(wiggle(JYF, JYA, PX))+(wiggle(FYF, FYA, PX));

value=[X[0], Y[1]]-[thisComp.width/2, thisComp.height/2];

}

 

Ement_0-1672130627977.pngexpand image

 

Translate
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 ,
Dec 27, 2022 Dec 27, 2022
LATEST

You just need to isolate the wiggle part of one of the wiggles by subtracting the current value. So the last part would be like this:

X=(wiggle(JXF, JXA, PX))+(wiggle(FXF, FXA, PX)-value);
Y=(wiggle(JYF, JYA, PX))+(wiggle(FYF, FYA, PX)-value);
[X[0], Y[1]]
Translate
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