FORUMS: list search recent posts

Change opacity every n-frames

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Luis Garcia
Change opacity every n-frames
on Oct 24, 2015 at 11:11:17 am

HI! I would need an expression to change the opacity betwen two values (30% and 0%) each n-frames.

I have 15 text layers with wiggle expressions, but 15 layers is too much. I would like some expressions to be able to show 7 text layers (with 30% opacity) for n-frames (imagine 18 frames) and then the other 8 text layers other 18 frames for example, and then appears again the first 7 text layers for 18 frames and every time with this secuence durinig all the clip.

Any idea to do this??

A lot of thanks in advance!!!

Good Weekend!


Return to posts index


Dan Ebberts
Re: Change opacity every n-frames
on Oct 24, 2015 at 5:50:59 pm

You could use something like this for the first group:

val1 = 30;
val2 = 0;
n = 18;
f = timeToFrames(time);
s = Math.floor(f/n);
s%2 ? val2 : val1

and switch the last line to this for the second group:

s%2 ? val1 : val2


Dan



Return to posts index

Luis Garcia
Re: Change opacity every n-frames
on Oct 24, 2015 at 9:44:08 pm

Thanks Dan, it works perfectly!!! A lot of thanks Dan.

I have another question... How I can modify this expressions to get, for example, three or four groups of text layers doing this....

For example:

Layer 1 - 18 frames opacity 30, and then 0 for 36 frames
Layer 2 - 18 frames opacity 0, 18 frames opacity 30, and 18 frames opacity 0 again
Layer 3 - 18 frames opacity 0, others 18 frames opacity 0, and then 18 frames opacity 30

I mean like three blocks of 18 frames, and each layer appears in one of this blocks.... would it be possible?

A lot of thanks!


Return to posts index



Dan Ebberts
Re: Change opacity every n-frames
on Oct 24, 2015 at 10:45:42 pm

This would be one way. You'd have to edit the first line for each layer:

pattern = [30,0,0];
n = 18;
f = timeToFrames(time);
s = Math.floor(f/n);
pattern[s%pattern.length]


Dan



Return to posts index

Luis Garcia
Re: Change opacity every n-frames
on Oct 25, 2015 at 10:05:55 pm

Great again Dan! It seems that works perfectly. I will try it more slowly and feedback. I supousse that if I want to create a 4 group, in the first line I will put this, isn´t it?

pattern = [30,0,0,0]

And then edit for each group....that´s right?

A lot of thanks!!!


Return to posts index

Dan Ebberts
Re: Change opacity every n-frames
on Oct 25, 2015 at 10:39:07 pm

That's correct.

Dan



Return to posts index


Luis Garcia
Re: Change opacity every n-frames
on Oct 26, 2015 at 9:05:18 am

A lot of thanks Dan for your answer and time....

That´s a great solution for "my problem".

I am wondering one thing now... I have 21 text layers, and I want to divide them into three groups...

I have tried to create three null objets and then linking each 7 text layers to their null object, and then apply the expressions into the null objects but I hadn´t any result...

Can´t I do it? Another way to do? Could I create a group or something like this or apply the expressions to my 7 layers at the same time??

Thanks again Dan!!!


Return to posts index

Luis Garcia
Re: Change opacity every n-frames
on Nov 10, 2015 at 11:26:39 pm

Hi! One Question Dan... If I precompose I lost my effect of this expression... Could I modify the expression to work with precomposing??

I am thinking to create one precompose for every 7 text layer to organize the project better, but when I have done it... I lost the effect of the expression...

Could you help me? How would be the expression with precompose?

Imagine I have 3 precompose....

Thanks in advance!


Return to posts index

Dan Ebberts
Re: Change opacity every n-frames
on Nov 10, 2015 at 11:57:35 pm

What exactly are you precomposing?

Dan



Return to posts index


Luis Garcia
Re: Change opacity every n-frames
on Nov 11, 2015 at 8:53:26 am

I am precomposing every 7 text layers, if I have 21 text layers, I am doing 3 precomposing with the same expressions... Yesterday, I did another prove and it worked... So I don´t know if perhaps before I will make a mistake....

Is correct to precompose with expressions and they have to work?

Thanks!


Return to posts index

Dan Ebberts
Re: Change opacity every n-frames
on Nov 11, 2015 at 2:55:13 pm

It depends on the expression. If it doesn't reference other layers it should be fine.

Dan



Return to posts index

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