ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Need assistance: trying to use external text file to update sports score at certain times

COW Forums : Adobe After Effects

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Tony JanksNeed assistance: trying to use external text file to update sports score at certain times
by on Apr 6, 2013 at 7:59:51 pm

Hi all,
I have been teaching myself After Effects (specifically around using expressions). Anyway, I record my daughter's volleyball games, render the MTS' as MP4, then share with the other parents. Now I would love to place a score overlay on the video prior to sharing. My score data is in text files and is represented in seconds elapsed in the video when a point scored. For example:

our_team_score_times = [15, 65, 87, 122];
opponent_team_score_times = [35, 100, 160];

Each number in the array is the seconds elapsed into the video when that team scored (score increments by 1). Using the example above, after 15 seconds, the score would be 1 to 0; after 160 seconds, the score would be 4 to 3.

So I have attempted many scripts, and am having trouble updating the score text after the appropriate seconds have elapsed as the comp runs. I can successfully read in the text file, but I can't get the score text to update after the right times. I tried "for" and "while" loops but couldn't get it to work. I tried "if" statements, comparing the current comp's time (converted from the frames) to my array elements, but it seems to only execute once, or my array index counter doesn't retain it's value when it increments and needs to compare against the next element in the array.

Should I be using something else (other than AE)? or some other method? or am I missing something entirely?

If possible, I really don't want to have to manually create keyframes or markers at the various times when each team scored. If there is a way to use these external files, that would be awesome.

Thanks in advance.


Return to posts index

Dave LaRondeRe: Need assistance: trying to use external text file to update sports score at certain times
by on Apr 7, 2013 at 4:15:12 am

I hate to tell you this, but you're trying to make AE do somethong it wasn't intended to do. Yes, TV Statuons can do it, but thst's because they have the proper equipment. The best you can do is to create a text keyframe, a Hold keyframe, and change it at the prkper point on the timeline.

Dave LaRonde
Former Sr. Promotion Producer
KCRG-TV (ABC) Cedar Rapids, IA


Return to posts index

Tony JanksRe: Need assistance: trying to use external text file to update sports score at certain times
by on Apr 7, 2013 at 4:48:24 am

Thanks for the response.

Maybe there is another technique to automate this. Is there a way to insert key frames or markers at specific frames or times using data from an external text file? Using expressions somehow?

If not, would there be another product within Adobe CS better suited for this?

My last resort may be to create a score overlay using flash and somehow re-record the video as I watch it, and update the flash overlay when a team scores, capturing both in the new video.


Return to posts index


John CuevasRe: Need assistance: trying to use external text file to update sports score at certain times
by on Apr 7, 2013 at 12:44:20 pm

If what you want to do is possible using expressions/scripts then the guys to ask are in the expressions forum. The guys that check/read that forum regularly will be able to give you a firm answer and a lot of direction.

Expressions forum

Johnny Cuevas, Editor
Thinkck.com

"I have not failed 700 times. I have succeeded in proving that those 700 ways will not work. When I have eliminated the ways that will not work, I will find the way that will work."
---THOMAS EDISON on inventing the light bulb.


Return to posts index

Tony JanksRe: Need assistance: trying to use external text file to update sports score at certain times
by on Apr 7, 2013 at 2:36:26 pm

Sorry about that. Is it possible to move this thread to that forum, or should I create a new thread?

Thanks.


Return to posts index

John CuevasRe: Need assistance: trying to use external text file to update sports score at certain times
by on Apr 7, 2013 at 2:40:22 pm

Don't know of way to move the thread, just start a new thread over there---and probably on Monday(not sure how much those guys check during the weekend) someone might have some ideas on how to go about what you are trying to do.

You might want to do some searches over there too, maybe someone has already figured it out.

Johnny Cuevas, Editor
Thinkck.com

"I have not failed 700 times. I have succeeded in proving that those 700 ways will not work. When I have eliminated the ways that will not work, I will find the way that will work."
---THOMAS EDISON on inventing the light bulb.


Return to posts index


Dan EbbertsRe: Need assistance: trying to use external text file to update sports score at certain times
by on Apr 7, 2013 at 5:35:20 pm

Assuming that you're getting the times from the text file into the arrays, something like this should work:


our_team_score_times = [15, 65, 87, 122];
opponent_team_score_times = [35, 100, 160];

our_team_score = 0;
for (i = 0; i < our_team_score_times.length; i++){
if (time < our_team_score_times[i]){
break;
}else{
our_team_score++;
}
}

opponent_team_score = 0;
for (i = 0; i < opponent_team_score_times.length; i++){
if (time <= opponent_team_score_times[i]){
break;
}else{
opponent_team_score++;
}
}

"Our Score: " + our_team_score + " Opponent Score: " + opponent_team_score


If it were me doing it, I would create a script that reads the text file, builds the expression, and applies it to the appropriate text layer, but the expression hack that uses $.evalFile() should work also.


Dan



Return to posts index

Tony JanksRe: Need assistance: trying to use external text file to update sports score at certain times
by on Apr 8, 2013 at 2:55:28 pm

Thanks Dan!

Worked Perfectly!

Now to find a genie to instantly render all my enhanced videos.


Return to posts index

Dan EbbertsRe: Need assistance: trying to use external text file to update sports score at certain times
by on Apr 8, 2013 at 6:06:34 pm

That's one big advantage of doing it with a script vs. an expression.

Dan



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]