Forum Replies Created

  • Actually, an even better way without all the time math is just to store the startTime in a variable, set the startTime of the layer to 0, do all your stuff, then set it back to the original time variable. The code below would be in a for loop to do this on each text layer.

    var theLayer = textLayers[i];

    var theSourceProp=theLayer.sourceText;

    var originalTime = theLayer.startTime;

    if (originalTime != 0) {

    theLayer.startTime = 0;

    }

    if (theSourceProp.numKeys > 0) {

    for (var keyIndex = 1; keyIndex <= theSourceProp.numKeys; keyIndex++) {

    textDocs.push(theSourceProp.keyValue(keyIndex));

    }

    }

    else if (theSourceProp.numKeys == 0) {

    textDocs.push(theSourceProp.value);

    }

    theLayer.startTime = originalTime;

  • 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]);

  • Well, I didn’t find a solution, but I found that FontMate has the same problem haha.

  • Thank you, Dan, for this and for everything. I was definitely asking why they’d want it to function that way.

    In the meantime, I’m going to try to work around it by getting key times and resetting values based on time…or something like that. I have some experimenting to do. I’ll be back if anything starts to look viable.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy