The Expressions Thread

cyzer said

Hello, guys n girls maybe some of you know how to extract keyframes from wiggle effect ? In example I just make wiggle expression and then I want all the timeline to be covered with those actual keyframes and then delete the wiggle expression. How to do that ?

After selecting the property that has the expressin go to Animation >> Keyframe Assistant >> Convert Expression to Keyframes. Image Explains That
Creattive said

@GloriousVids

you need to use the “linear” function on the opacity for that.

linear( :pickwhip the x-value of your slider object: , 151, 582, 0, 100)

Hallo there I to use need the same function (layers position affect opacity of another layer) for a
"customization panel" I am working right now.

My layers x position already affects the opacity of the “childs layer” but not in the 0-100 scale.
So I need some more detailed information on how to apply that line:
linear( :pickwhip the x-value of your slider object: , 151, 582, 0, 100)

Thanks

Hello Pixelit_Plus!
It is hard to write it all but my image explains a lot. (I hope)
Anyway, i made it and it works just fine. I made a bar length of 300px. You can see the image below and the code refercing 300. Thats the length theat represents 100% opacity.
With this code it does not matter where the slider is. Link the arrow to Bar!!!

As you can see, i’m trying to make a “percentage circle”, and i’m having big struggles parenting the text in the middle to the opposite amount of the radial wipe from the blue circle, the problem is that i would like to be able to do this :

  • If the transition completition is at 90%, the text will say 10%
  • If the transition completition is at 10%, the text will say 90%
  • If the transition completition is at 50%, the text will say 50%
If possible, i would also like to display the "%" symbol after the number Thanks for your answers
MartinLemaire said

As you can see, i’m trying to make a “percentage circle”, and i’m having big struggles parenting the text in the middle to the opposite amount of the radial wipe from the blue circle, the problem is that i would like to be able to do this :

  • If the transition completition is at 90%, the text will say 10%
  • If the transition completition is at 10%, the text will say 90%
  • If the transition completition is at 50%, the text will say 50%
If possible, i would also like to display the "%" symbol after the number Thanks for your answers
The solution is to subtract from the value 100 then multiply it by -1

To add " % " mark, it’s simple just add to that (" % ")

This is how the expression looks like :

((Pickwhip your radial wipe transition value - 100)*-1) + ("%")

The only problem is the text will show many numbers after the comma, i saw a solution in one of Felt_tips videos but i can’t remember what is the name of that video.

Good luck

osama_sayegh said

The only problem is the text will show many numbers after the comma, i saw a solution in one of Felt_tips videos but i can’t remember what is the name of that video.

Okay thanks, i’ll try to solve this problem by myself :slight_smile:

Bad news, after typing your expression this message appears :frowning: any tips ?

MartinLemaire said

Bad news, after typing your expression this message appears :frowning: any tips ?

Looks like you've missed the two brackets at the beginning of the expression
((Pickwhip your radial wipe transition value - 100)*-1) + ("%")

Replace only “Pickwhip your radial wipe transition value”, anything else is important

tut

If the image is not clear, click here

Good luck

^ It works ! Thanks you sir :smiley:

However, i don’t find any answers for the problem about numbers after the comma…

MartinLemaire said

^ It works ! Thanks you sir :smiley:

You are welcome ! (No need for “sir” :slight_smile: )

MartinLemaire said

However, i don’t find any answers for the problem about numbers after the comma…

Math.round(((REPLACE THIS - 100)*-1)) + ("%")
This expression removes all the numbers after the comma, replace only "REPLACE THIS" with your value

Good luck

Okay man, but i would to make it change through the time, when i apply your expression, the number stays to 100% :frowning:

MartinLemaire said

Okay man, but i would to make it change through the time, when i apply your expression, the number stays to 100% :frowning:

I think the problem is that you have not animated the transition completion, have you ? if yes, please post a screenshot

^


I did

MartinLemaire said

^


I did

Sorry, my mistake, i didn't mention that you have to remove the old expression, just use this
Math.round(((REPLACE THIS - 100)*-1)) + ("%")
replace "REPLACE THIS" with transition completion value

Thanks for your time!
I have tested your “example” but unfortunatelly I the “Arrow” layer cant be moved at all! in order to affect “shape tester” opacity!

What I did is this line for the layer affected
comp(“For_Customization”).layer(“Text_Glossiness_Slider”).transform.xPosition

And this layer which x position is affecting tha above layer opacity
x = clamp(position[0], 0,100);

What I would like to accomplish is:

  1. The x distance to be more than 100 pixels to be more “detailed” for the selection
  2. If there is a way to limit the the x position “slider” to 10 steps.

Thanks

osama_sayegh said
MartinLemaire said

I did

Sorry, my mistake, i didn't mention that you have to remove the old expression, just use this
Math.round(((REPLACE THIS - 100)*-1)) + ("%")
replace "REPLACE THIS" with transition completion value

Thank you so much osama !

Pixelit_Plus said

Thanks for your time!
I have tested your “example” but unfortunatelly I the “Arrow” layer cant be moved at all! in order to affect “shape tester” opacity!

What I did is this line for the layer affected
comp(“For_Customization”).layer(“Text_Glossiness_Slider”).transform.xPosition

And this layer which x position is affecting tha above layer opacity
x = clamp(position[0], 0,100);

What I would like to accomplish is:

  1. The x distance to be more than 100 pixels to be more “detailed” for the selection
  2. If there is a way to limit the the x position “slider” to 10 steps.

Thanks

Here is the project. Hope it will help (AE CC): link

That exactly what I was looking for!!! BIG Thanks!!!

Is there a way to help me with a second “object’s x position” slider?

What I need is object x position to REPLACE A FUNCTIONAL slider used as a background selector which background frames are in another comp.
So has to be step limited lets say 1 to 10 (every frame links a background choice)

This slider (used in a control panel) is a “selector” used in conjunction
with this script line:
state=comp(“1_For_Customization”).layer(“Controls”).effect(“Background”)(“ADBE Slider Control-0001”);
framesToTime(state);

WeTransfer Link of the slider surface selector already working which I want to replace an object x 10 stepped position:
http://we.tl/IcI1RdQ3DM

Pixelit_Plus said

That exactly what I was looking for!!! BIG Thanks!!!

Is there a way to help me with a second “object’s x position” slider?

What I need is object x position to REPLACE A FUNCTIONAL slider used as a background selector which background frames are in another comp.
So has to be step limited lets say 1 to 10 (every frame links a background choice)

This slider (used in a control panel) is a “selector” used in conjunction
with this script line:
state=comp(“1_For_Customization”).layer(“Controls”).effect(“Background”)(“ADBE Slider Control-0001”);
framesToTime(state);

WeTransfer Link of the slider surface selector already working which I want to replace an object x 10 stepped position:
http://we.tl/IcI1RdQ3DM

What you basically need is an switch function. I used it in my universal counter in infographics kit template. I needed different currency sign in suffix (dollar, euro, yen etc). Drivable by slider control. So that value on slider was: 0=no suffix, 1=dollar, 2=euro etc.

switch(expression) {
case n:
code block
break;
case n:
code block
break;
default:
default code block
}