ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

# Shape Layer - Offsetting shape rotation from within comp

FAQ   •   VIEW ALL
 Shape Layer - Offsetting shape rotation from within comp on Dec 3, 2015 at 7:09:13 am

Hi,

This is a fairly complex question for me to ask. I have made a custom shape in a 100x100 comp. I've then converted the shape layer to react to a 3d space and given all axis a time*150 rotation expression. Then, I've placed that comp in a 1080 comp and duplicated it. Now, the problem is that all these copies rotate in the exact same way, and I want to figure out a way to offset their rotation. Any suggestions?

Thank you!!!

 Re: Shape Layer - Offsetting shape rotation from within compon Dec 3, 2015 at 11:46:50 am

Use the "index" property of the layer in the expression to modify the values.

You could add a multiple of the index to the initial rotation if you just want a different rotation state.

If you want the layers to rotate at different speeds, you can either use index to multiply or add to the rotation speed. Or, better, use index as the randomseed for the layer, then use random values to modify the rotation speeds. A fixed randomseed should produce fixed sequence of random numbers for the different layers.

 Re: Shape Layer - Offsetting shape rotation from within compon Dec 3, 2015 at 12:09:47 pm

Hi Kalle!

Thank you for your swift response. See, I'm new to expressions. I've mostly just copied and pasted. Can you suggest me an expression that might work for this?

 Re: Shape Layer - Offsetting shape rotation from within compon Dec 3, 2015 at 7:26:26 pmLast Edited By Kalle Kannisto on Dec 3, 2015 at 7:29:31 pm

This should do it:

seedRandom(index,true);
rotationspeed = 100+random()*100;
rotationstart = 360 * random();
rotationstart+time*rotationspeed

You layers will now start each at a different initial rotation and have an individual rotation speed between 100 and 200 for every axis.

Note: Apply it to the x, y, and z rotation values of the 100x100 comp, not the shape inside the comp.

 Re: Shape Layer - Offsetting shape rotation from within compon Dec 4, 2015 at 6:15:45 am

Hi Kalle,

This is great, thanks so much!! Just one more question if you don't mind, what if I had to offset the Y position for the 100x100 comp. So, that when I duplicate the layers they appear to be floating in 3d space, you know, with an offset? I'm sorry to be asking so many questions.

 Re: Shape Layer - Offsetting shape rotation from within compon Dec 4, 2015 at 12:42:32 pm

You can separate the dimensions and apply a wiggle to the y position.

wiggle(wiggles per second, amount)