"Undefined Value" error in expression, always on line 1, even when line 1 is just a comment
I'm trying to trigger animations in the position property of one layer using markers on another layer, but the expression keeps returning an error: "Undefined value used in expression (could be an out of range array subscript?)". Weirdly, the error just disappears every now and then until I hover over the timeline again. This error occurs in the first line of code, even when that line is commented out or when I delete the line. For reference, I just updated to v 24.6.2, but even when I rolled back to 24.6.1 the error occurred.
If I end the expression with a fixed-value array, such as [5,5], the error disappears, but of course this makes my code redundant.
The expression:
/* 2 states: (1) Normal, for when in left or right view, and (2) Wide, for center view. */
/* This layer will ease() between Normal & Wide for the center values of the master controller layer. */
/* Variables */
control = thisComp.layer("BG_PosControl"); normal = [517, 0]; wide = [-639.5355, 0];
fadeFrames = thisComp.layer("BG_PosControl").effect("TransitionLengthInFrames")("Slider"); m = 0; t = time;
/* Condition Statements */
if (control.marker.numKeys > 0) {
m = control.marker.nearestKey(time).index;
tag = control.marker.key(m).comment;
t = control.marker.key(m).time - time;
if (tag == ("Left"||"Right"||"RightFromLeft"||"LeftFromRight")) { ease(t, framesToTime(fadeFrames), 0, wide, normal) }
else if (tag == ("CenterFromLeft"||"CenterFromRight")) { ease(t, framesToTime(fadeFrames), 0, normal, wide) }
}
else { value }
