ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Expression correction

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Vivien Lemaignan
Expression correction
on Jan 15, 2018 at 4:02:07 pm

Hi guys,

I need your help on this expression,
I put two keyframe in opacity (0 and 100)
I have always the same message "error at line 6.. Expected ☺ :
Thanks a lot

Vivien

//–Flicker On
//Make something flicker to 100% opacity instead of fading in
//Adjust this flicker frequency to your taste
flickerFrequency = 50;
// Only run expression while fading on/off.
if (value 0) {
opacityValue = value;
} else {
opacityValue = 0;
}
} else {
opacityValue = value;
}
opacityValue;
//–end Flicker On


Return to posts index

Dan Ebberts
Re: Expression correction
on Jan 15, 2018 at 5:25:49 pm

I don't think that expression will actually do anything. What are you trying to do exactly?

Dan



Return to posts index

Vivien Lemaignan
Re: Expression correction
on Jan 15, 2018 at 6:16:27 pm

Thanks Dan to you answer,
I just want to have a progressive flickering between two keyframe 0 to 100 opacity for a progressive apparition.
Below this expression is running but the opacity value is just 0 or 100.

Thanks for your help Dan

Vivien

//--Flicker On
//Make something flicker to 100% opacity instead of fading in
//Adjust this flicker frequency to your taste
flickerFrequency = 150;
op = value;
if(op > 0 && op &lt; 100){
reverseAmt=100-transform.opacity;
wiggledAmt=wiggle(flickerFrequency,reverseAmt);
roundedAmt=Math.round((wiggledAmt/100));
roundedAmt*100;
}
//--end Flicker On


Return to posts index


Dan Ebberts
Re: Expression correction
on Jan 15, 2018 at 6:30:55 pm

I don't understand the "between two keyframes" part. Do the keyframes define the duration of the flicker? I'm having trouble picturing what this should look like.

Dan



Return to posts index

Vivien Lemaignan
Re: Expression correction
on Jan 16, 2018 at 10:26:30 am

Sorry for my unclearness..
Yes the keyframe define the duration
I have 2 keyframe, the first at 0 % of opacity and the second at 100 %, one second later.
For the moment with my expression the flickering is only binary (0 or 100), i want progressive random flickering that is to say : (0, 20, 5, 80, 35, 40.... 100)
Is it clearer for you?
Thanks Dan
Vivien


Return to posts index

Dan Ebberts
Re: Expression correction
on Jan 16, 2018 at 5:07:42 pm

Maybe something like this:


t1 = key(1).time;
t2 = key(2).time;
if (time > t1 && time < t2){
random(value);
}else{
value
}



Dan



Return to posts index


Vivien Lemaignan
Re: Expression correction
on Jan 16, 2018 at 5:55:55 pm

Thanks Dan
It's almost perfect ☺
Is it possible to change the intensity of flickering with a slider or a value (time per second)?
Thanks a lot Dan

Vivien


Return to posts index

Dan Ebberts
Re: Expression correction
on Jan 16, 2018 at 6:31:12 pm

You could do something like this to get it to change every 2 frames, for example:


f = 2; // change every 2 frames
t1 = key(1).time;
t2 = key(2).time;
if (time > t1 && time < t2){
seed = Math.floor(timeToFrames(time-t1)/f);
seedRandom(seed,true);
random(value);
}else{
value
}


Dan



Return to posts index

Vivien Lemaignan
Re: Expression correction
on Jan 23, 2018 at 4:46:23 pm

Thanks a lot Dan you are the best, it's perfect!
All best
Vivien


Return to posts index

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