ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Change Color In layer order every 5 frames

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
josh boyd
Change Color In layer order every 5 frames
on Mar 17, 2020 at 5:32:42 pm

I have a composition with close to 200 layers, and i want to make it where the color changes from a dark blue to a red. I was looking for an expression i could just copy and paste to all layers.

I dont know expressions super well, but basically an expression that gets the layer number and multiplies it by 5 to get the frame it is supposed to change at. I want the transition from the color to color to be about 10 seconds. Is this possible? Or is this too much?

Thank you so much!


Return to posts index

Andrei Popa
Re: Change Color In layer order every 5 frames
on Mar 17, 2020 at 6:17:26 pm

This should work.
Replace the hex numbers between quotes with the hex number of your colors.

linear(time,index*5,index*5+10,hexToRgb("FF0000"),hexToRgb("000000"))

Andrei
My Envato portfolio.


Return to posts index

josh boyd
Re: Change Color In layer order every 5 frames
on Mar 17, 2020 at 6:23:23 pm

This is what I am sort of looking for, except could it be every the 5 sec be every fifth frame and the duration be 10 frames instead of 10 sec.

Thank you so much!


Return to posts index


josh boyd
Re: Change Color In layer order every 5 frames
on Mar 17, 2020 at 6:32:07 pm

I think i figured it out, as i am slowly learning this expression language.

I just change time to timeToFrames(time)?


Return to posts index

Andrei Popa
Re: Change Color In layer order every 5 frames
on Mar 17, 2020 at 7:17:42 pm

Close!

But this is the expression you need.

linear(time,framesToTime(index*5),framesToTime(index*5+10),hexToRgb("FF0000"),hexToRgb("000000"))

Every expression in After Effects calculates time in number, not frames. The 15th frame in a 30 fps composition is a 0.5 time. For example framesToTime(15) turns the number 15 into a 0.5 in a 30 fps composition. That is exactly the kind of transformation you need.

Andrei
My Envato portfolio.


Return to posts index

josh boyd
Re: Change Color In layer order every 5 frames
on Mar 17, 2020 at 9:19:41 pm

Thank Andrei, I love when people explain it. It helps me understand how it is happening so i can learn more.


Return to posts index

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