Hi Dan, thanks for your interest,
This is my expression..
timeOffset = comp("Comp 1").layer("White Solid 1").effect("Slider Control")(1);
valueOffset = comp("Comp 1").layer("White Solid 1").effect("Slider Control 2")(1);
MinTime = key(1).time + timeOffset;
MaxTime = key(2).time+ timeOffset;
MinValue = key(1).value + valueOffset;
MaxValue = key(2).value + valueOffset;
ease(time, MinTime, MaxTime, MinValue, MaxValue);
Basically I have this expression in tens of layers in tens of compositions, so for some reason I want to subtract “valueOffset” from “MinValue” variable instead of adding it, or just remove it completely, just in couple of compositions. As you know, going through the property of each layer in a lot of compositions is a pain in the butt, no one wants to do this manually.
So I want my script to replace this:
MinValue = key(1).value + valueOffset;
MaxValue = key(2).value + valueOffset;
with:
MinValue = key(1).value - valueOffset;
MaxValue = key(2).value - valueOffset;
(I know that this is exactly the same if the value of valueOffset is negative in the original expression, but for some reasons I would like to change the expression)
or:
MinValue = key(1).value;
MaxValue = key(2).value;
I’m open-minded to any solution, I’m not requiring to be the way I made it above (converting the expression to string then using the replace() method etc..), any way to do that is welcome.
Thanks!