Got it. Using time-based values instead of key-based values, I could offset where it reads the values by subtracting the layers’ startTime from each keyTime.
if (sourceTextProps[i].numKeys > 0) {
offsetTimes[i] = textLayers[i].startTime;
for (var keyIndex = 1; keyIndex <= sourceTextProps[i].numKeys; keyIndex++) {
keyTimes[i] = sourceTextProps[i].keyTime(keyIndex) - offsetTimes[i];
textDocs.push(sourceTextProps[i].valueAtTime(keyTimes[i], null));
}
}
Then later, when I’m setting values:
sourceTextProps[i].setValueAtTime(keyTimes[i] + offsetTimes[i], tD[i]);