509 posts
    Has referred 10+ members Has sold $10,000+ on Envato Market Has been a beta tester for an Envato feature Has collected 10+ items on Envato Market
+3 more
5p1r17 says

Hi there,

I’ve checked hundreds of AE expression sites and can’t find a simple tip: How to change certain key value with expression. In my case, I created a Slider which should change 2-nd key value of particular effect, but can’t find the way to make it work right….

my expression:

f=effect(“Particular”)(3).key(2).value;

f=thisComp.layer(“SLIDER_LAYER”).effect(“TestXXX”)(“Slider”);

This expression is inside the “particles\sec.” property….

5069 posts
    Has referred 200+ members Has sold $125,000+ on Envato Market Has collected 50+ items on Envato Market Elite Author: Sold more than $75,000 on Envato Market
+11 more
felt_tips Envato team says

You can’t.

You can read a key value, but not set it.

You can only set the value at the current time with expressions. Otherwise if you want to set the value of specific keyframes, you need to look at Extendscript and scripting.

Your two lines of expression above set the same value twice. The variable f is first set to the value of key 3 on the Particular property. Then it is overwritten by setting it to the value of the TestXXX slider.

You could try something along the lines of testing whether the current time is the same time as a certain key’s time and if so, then setting the property to a certain value, but I think this isn’t what you’re trying to achieve.

-f.

509 posts
    Has referred 10+ members Has sold $10,000+ on Envato Market Has been a beta tester for an Envato feature Has collected 10+ items on Envato Market
+3 more
5p1r17 says

Thanks for fast reply Felt!

Things become more complicated than I thought…. :D

Anyway, thank you again!

-Vlad

by
by
by
by
by
by