ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

AECC2017 Script for "Slider to Opacity" trouble

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
fabiano noli
AECC2017 Script for "Slider to Opacity" trouble
on Nov 17, 2019 at 12:40:38 am

Hi Community!

I have a trouble with my script

I use AEC2017 and I want that the opacity of my Precomp is "turned off" when my slider control is equal or less than 0,02

So
I used a Script of CreativeCow Brother that I found in this blog.
And this script is:
ctrl = thisComp.layer("control").effect("Slider Control")("Slider");
if ( Math.floor( ctrl ) == 1 ) 100 else 0;

In this case, with other value obviously, this script works great!
And the mist started to disappear.

But when I change that in this:
ctrl = thisComp.layer("Master").effect("Slider Control")("Slider");
if ( Math.floor( ctrl ) <= 0,02 ) 100 else 0;

don't works anymore

Can You help me?
Thank you for your time

ps. I tried also these:
-if(thisComp.layer("Master").effect("Slider Control")("Slider")<=0,02) 100 else 0
-if(thisComp.layer("Null 1").effect("Slider Control")("Slider")<=0,02) 100; else 0
-if(thisComp.layer("Null 1").effect("Slider Control")("Slider")<=1) { 100 }else{ 0 }


Return to posts index

Dan Ebberts
Re: AECC2017 Script for "Slider to Opacity" trouble
on Nov 17, 2019 at 5:49:10 am

Try this:

ctrl = thisComp.layer("Master").effect("Slider Control")("Slider").value;
ctrl <= 0,02 ? 100 : 0


Note that I'm not sure about the 0,02 punctuation, here it would be 0.02

Dan



Return to posts index

fabiano noli
Re: AECC2017 Script for "Slider to Opacity" trouble
on Nov 17, 2019 at 5:18:01 pm

Hi Dan,
thanks for your time!
Your script is great!
It worked!!!
:)


Return to posts index


Gonzalo Menevichian
Re: AECC2017 Script for "Slider to Opacity" trouble
on Nov 17, 2019 at 7:46:43 pm

Hi Dan

I pretty Newby on the expression script I have this line:

(thisComp.layer("Slider").effect("Slider Control")("Slider").value >= 50) ? 0 : 100;

That it work well but I would like to add "if is <=10 or =>50" then ? 0 : 100;
How Could I do that?

Thanks!
G


Return to posts index

Dan Ebberts
Re: AECC2017 Script for "Slider to Opacity" trouble
on Nov 17, 2019 at 8:02:45 pm

Like this:

s = thisComp.layer("Slider").effect("Slider Control")("Slider").value;
(s <= 10 || s >= 50) ? 0 : 100;


Dan



Return to posts index

Gonzalo Menevichian
Re: AECC2017 Script for "Slider to Opacity" trouble
on Nov 17, 2019 at 8:08:32 pm

OMG!
It works!!!!

Thank you so much!!!!


Return to posts index

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