-
Issue: Cannot read properties of undefined (reading ‘split’)
Hello!
I’m in the process of building a “dumb” information video wall. We hold a conference at a fancy-schmancy hotel in Colorado that has a large video wall but won’t provide me direct access to it. I have to provide them with a series of 2-hour-long video files to be played in a specific order, at specific times to mimic a smart info wall. This includes a clock, a series of rotating videos, and most importantly a scrolling agenda. The agenda moves according to the time and what’s “Currently On.”
Last year, I manually keyframed each movement, which is a pain in the rear. This year, I am writing a function to automate this. I still have to keyframe the movement, but it’s in one comp, one whole move each frame. The script then tells the comp to ease to the next agenda item based on an array. There’s a “scroller” comp, which moves all of the items up by one, and a “fader” comp, which fades out the last highlighted on-now item, and fades in the current one.
I’ve been able to write the majority of the script in the “source text” of a text layer, output it to the screen as a hidden comma-delimited guide layer. I’m then able to import it via pick-whip and split function into other comp layers to drive the movement, time-remapping, and opacity. This way, I didn’t have to rewrite the script multiple times and if I make changes, the bulk of it is done in the script text layer.
It works, but briefly. If the expression is disabled and then reenabled in the text layer, I get cannot read properties of undefined (reading ‘split’), specifically on the line:
futurehours = nextTime.split(":")[0]*3600;here’s the script in its entirety:
switchTimes = [“15:00:00:00″,”15:00:10:00″,”15:00:20:00″,”15:00:30:00″,”15:00:40:00″,”15:00:50:00″,”15:00:60:00”]; // a series of times to test
for (arrayNum = 0;timeToCurrentFormat() >= switchTimes[arrayNum];arrayNum++) { // conditional test if the current time is before switchTimes
// This coverts the current switchTimes from HH:MM:SS:FRAMES to seconds
currentTime = switchTimes[arrayNum];
hours = currentTime.split(“:”)[0]*3600;
minutes = currentTime.split(“:”)[1]*60;
seconds = currentTime.split(“:”)[2]/1;
frames = currentTime.split(“:”)[3]*thisComp.frameDuration;
currentTrigger = hours + minutes + seconds + frames;
// This coverts the next switchTimes from HH:MM:SS:FRAMES to seconds. This is necessary to trigger fade outPoint
nextTime = switchTimes[(arrayNum+1)];
futurehours = nextTime.split(“:”)[0]*3600;
futureminutes = nextTime.split(“:”)[1]*60;
futureseconds = nextTime.split(“:”)[2]/1;
futureframes = nextTime.split(“:”)[3]*thisComp.frameDuration;
nextTrigger = futurehours + futureminutes + futureseconds + futureframes;
shiftVariable = thisComp.layer(“# CONTROL SLIDERS”).effect(“Transition Time”)(“Slider”); // tied to slider to adjust global transition time
compCurrentTime = thisComp.displayStartTime+time; // Adds the comp start time to time
varFrameRate = 1/thisComp.frameDuration; // Converts frame duration to FPS
EaseFrom = (arrayNum-1)/varFrameRate; // Converts whole number arrayNum, which equates to single from in subcomp, to FPS for easing from
EaseTo = arrayNum/varFrameRate; // Converts whole number arrayNum, which equates to single from in subcomp, to FPS for easing to
dataDump = arrayNum+”,”+currentTrigger+”,”+shiftVariable+”,”+compCurrentTime+”,”+EaseFrom+”,”+EaseTo+”,”+nextTrigger; // “exports” to screen a comma-delimited list for import elsewhere
}
Sorry, there were no replies found.