Copy link to clipboard
Copied
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.
1 Correct answer
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
Copy link to clipboard
Copied
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];
}
Copy link to clipboard
Copied
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]]

