FORUMS: list search recent posts

Combining two expressions

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Martin Hausman
Combining two expressions
on Oct 24, 2014 at 2:19:27 pm

Hi, I'm using this expression to distribute 64 layers in Z space.

start =thisComp.layer("Position Null").effect("zPosition")("Slider");
diff = thisComp.layer("Position Null").effect("zSpacing")("Slider");
[position[0], position[1], start +(index-1)*diff]

The expression works well, but I need all 64 layers to wiggle randomly.

For the wiggle I found this expression:

//Start of Script
[wiggle(thisComp.layer("Controller").effect("X Frequency")("Slider"),
thisComp.layer("Controller").effect("X Amplitude")("Slider"))[0],
wiggle(thisComp.layer("Controller").effect("Y Frequency")("Slider"),
thisComp.layer("Controller").effect("Y Amplitude")("Slider"))[1],
wiggle(thisComp.layer("Controller").effect("Z Frequency")("Slider"),
thisComp.layer("Controller").effect("Z Amplitude")("Slider"))[2]]
// End of Script

When I put the two expressions together into position value of each layer they don't work.
Can someone please help combine these two expressions so that I can apply them to each layer position.

Thank you in advance.


Return to posts index

Dan Ebberts
Re: Combining two expressions
on Oct 24, 2014 at 4:25:35 pm

I haven't tested this, but something like this should work:

w = [wiggle(thisComp.layer("Controller").effect("X Frequency")("Slider"),
thisComp.layer("Controller").effect("X Amplitude")("Slider"))[0],
wiggle(thisComp.layer("Controller").effect("Y Frequency")("Slider"),
thisComp.layer("Controller").effect("Y Amplitude")("Slider"))[1],
wiggle(thisComp.layer("Controller").effect("Z Frequency")("Slider"),
thisComp.layer("Controller").effect("Z Amplitude")("Slider"))[2]]-value;

start =thisComp.layer("Position Null").effect("zPosition")("Slider");
diff = thisComp.layer("Position Null").effect("zSpacing")("Slider");
[position[0], position[1], start +(index-1)*diff]+w


Dan



Return to posts index

Martin Hausman
Re: Combining two expressions
on Oct 24, 2014 at 4:29:31 pm

Awesome, works great.
Thank you so much Dan.

Regards.
Martin


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]