I used the following expression, from Dan Ebberts on a post several years old, to control the time between two position keyframes. I now need to do the same thing only on a mask, but still just needing to control the time between the two keyframes.
When I apply it to the mask path I get the error "Expression Disabled: This property has no keyframe number 26."
I have changed the k1 and k2 variables just to see if it would work with different keyframes but to no avail. There are definitely keyframes on the layer.
Maybe this expression will not work with mask keyframes?
holdTime = thisComp.layer("Control").effect("Slider Control")("Slider")-1;
k1 = 26; // 1st hold keyframe
k2 = 27; // 2nd hold keyframe
p = transform.position;
t1 = p.key(k1).time;
t2 = t1 + holdTime;
if (time < t1)
t = time
else if (time < t2)
t = linear(time,t1,t2,t1,p.key(k2).time)
t = p.key(k2).time + (time - t2);