After Effects Expression Trouble - Disabling itself, but it works, kind of…
I've got an expression on a layer's CC Power Pins, that selects the value at a keyframe depending on the Time Remap of a different layer.
The code works, except for certain points where it disables itself and tells me that there is no keyframe 21.
It should never be referencing 21, and if I just put the output to [l,l] it always shows me the number it should.
t = thisComp.layer("Masked").timeRemap;
f = timeToFrames(t);
l = Math.round(f/2)+1;
key(l);
The weird thing is that when it disables itself it still gives the right result in the values, but it doesn't display correctly in the comp. I have a duplicate layer beneath it for a shadow, and the CC Power Pin for that layer just references the 1st layer for its values. That displays fine throughout.
Where is it getting 21 from? What am I doing wrong? Any ideas?
