Ideally, this would be some kind of automatic thing where you would say "start counting on this frame" and a "SMPTE timecode like" readout would be overlayed in a "user specifiable" location of the frame. I'm not a programmer(unfortunately), so I can't write it myself. Do you think it would be difficult to write such a plugin?
Any thoughts appreciated! Thanks!
In fact, you don't really need a plug-in for this, you could simply create a counter animation showing the SMPTE code, and apply it using Video Post. You can slide the counter animation in the Video Post to start or end on a specified MAX frame with a certain value.
I might write an Expression Controller-Driven digital counter animation in MAX that would generate any SMPTE counter for you and write to a separate Flic, Avi or single images. You can then apply it to any other video source or MAX animation using Video Post and/or Stamper 1.1 which supports animated images.
OK, here is the promised animation...(Updated to work with any FPS and any animation lenght on 4/21/97!)
This is a simple MAX scene that will let you render any SMPTE timecode to any animation format to use in Video Post as a counter. This is a workaround, a real plug-in like in 3DS DOS would be easier to use, but I am not a coder, too. This is an interesting example of Expression Controller usage, and I found some strange things (bugs?) when trying to create it that would be important to know...
Here is how it works:
We have now a counter that displays zeros on all positions. We have to change the digits according to the current animation time:
For the right frame digit:
mod((T/(TPS/FPS))-(floor(T/(TPS/FPS)/FPS)*FPS),10)+1
FPS is a Scalar assigned to the Linear Float controller of the 3rd track of the Star.
Why is it so complex? An example: the current time is 20480 ticks, the FPS=30 (NTSC), so the counter should show 00:04.08
mod((20480/(4800/30))-(floor(20480/(4800/30)/30)*30),10)+1
For the left frame digit:
floor((T/(TPS/FPS))-(floor(T/(TPS/FPS)/FPS)*FPS))/10)+1
FPS is a Scalar assigned to the Linear Float controller of the 3rd track of the Star.
An example: the current time is 20480 ticks, the FPS=30 (NTSC), so the counter should show 00:04.08
floor((20480/(4800/30))-(floor(20480/(4800/30)/30)*30))/10)+1
For the right seconds digit:
floor(mod(S,10))+1
It uses the system variable S that returns the elapsed seconds. We just take the right digit .
For the left seconds digit:
floor(S-(floor(S/60)*60)/10)+1
It counts from 0 to 5 and uses S for elapsed seconds.
For the right minutes digit:
floor(mod(S/60,10))+1
For the left minutes digit:
floor(S/600)+1 The counter will always count according to the FPS settings in the Star Shape. To get the same readout as on the time slider, be sure to have the same fps value in the MAX time settings. You can add the rendered counter to any other animation using Video Post and an Alpha Composer. For best results use an IFL file list and 32bit TGAs or any PNG mode with Alpha channel.
As already mentioned, the other bug (?) I discovered was the inability to render the texture of the 1st of 10 Sub-Materials in a Multi/Sub Material when the Mat.ID becomes 11. The shaded viewport displays it correctly,though...
T returns the current time in ticks.
TPS always returns 4800 ticks/sec.
mod returns the remainder of the division
+1 makes a result of 0 come out as 1, because Mat.ID cannot be 0, and our zero digit has Mat.ID of 1.
Most of you know that when you assign a Mat.ID greater than the number of Sub-Materials, a repeated assignment occurs - with 6 Sub-Materials, a Mat.ID of 8 would show Sub-Material 2. It worked perfectly in the Shaded Display, but as I wanted to render, any value greater than the number of Sub-Materials refused to show the map, it displayed just a shaded rectangle. Also, the Material Modifier allows up to 65536 Sub-Materials. That's why the formula had to return only repeating values between 0 and 9.
mod((20480/(160))-(floor(20480/(160)/30)*30),10)+1
mod((128)-floor(128/30)*30),10)+1
mod((128)-floor(4,266666666)*30),10)+1
mod((128)-4*30),10)+1
mod((128)-120),10)+1
mod(8,10)+1
The remainder of 0.8 is 8
8+1=9
The expression will put 9 as Mat.ID and the Multi/Sub Material will display the digit 8 on the rectangle.
T returns the current time in ticks.
TPS always returns 4800 ticks/sec.
floor returns the largest integer smaller than or equal to.
floor((20480/(160))-(floor(20480/(160)/30)*30))/10)+1
floor((128)-(floor(128/30)*30))/10)+1
floor((128)-(floor(4,266666666)*30))/10)+1
floor((128)-(4*30))/10)+1
floor((128)-(120))/10)+1
floor(8/10)+1
Floor from 0.8 is 0
0+1=1
The expression will put 1 as Mat.ID and the Multi/Sub Material will display the digit 0 on the rectangle.
While working on this tutorial, I discovered a little problem with the F system variable of the Expression Controller. It was impossible to use it to determine the current frame in ANY fps mode (like PAL or Film) since it always returned the current frame in NTSC 30 fps format... :o(
This seems to me to be a bug (or limitation?) of the Expression Controller. That's why I used Ticks in the updated version of the counter. It would be nice to have a TPF or FPS system variable in future updates of the Expression Controller, or a F system variable that functions properly...
Universal SMPTE Counter
Copyright (c) 1997 by Borislav Petrov