Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Script cannot set effect property value

  • Script cannot set effect property value

    Posted by Anna Petkovskaya on May 3, 2019 at 10:42 am

    I have a layer that has “Dust & Scratches” effect applied.
    The layer has several Time Remap keyframes and I am applying this code on that Time Remap property like this:

    effect("Dust & Scratches")("Threshold") = 60;

    But I got error saying “Cannot apply value” – does anyone know why?

    Filip Vandueren replied 7 years ago 2 Members · 1 Reply
  • 1 Reply
  • Filip Vandueren

    May 6, 2019 at 7:55 am

    You should apply an expression to the property you want to effect, not to time-remapping.

    There is no way to set the value of property B from within an expression on property A.
    An expression should always yield a value that is used instead of the current keyframed value of the property it is applied to.

    if you want to know the value of the Threshold you would use a = effect("Dust & Scratches")("Threshold"); But you can only read that value, not set it.

    So, if you want Threshold to always be 60 regardless of it’s keyframes or time, simply apply this expression to it:

    60;

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy