Q: I need to create an "elapsed time" readout over my MAX animations for forensic animation work. There was an IPAS for 3DS4 that did this but I can't find any similar plugin for MAX. Do you know of an automated plugin to do this? Forensic animators have to be doing this somehow in MAX.

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!


A: It should be relatively easy to program. There is a free plug-in called Stamper, but it embosses only a bitmap or animation over the screen. You might want to contact its author Andrey Zmievsky at http://thelonius.ispi.net/~andrey/software.html

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.


Addition:

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:

  • Create a Rectangle.
  • Apply a Material Modifier.
  • Copy the Rectangle 5 times for the Minutes, Seconds and Frames.
  • Create a small rectangle or circle for the dot, apply EditMesh and copy it for the separators "." and ":". Use a self-illum white Material.
  • In the Material Editor, create a new Multi/Sub Material.
  • Set the number of Sub-Materials to 10, and name it "Decimal Counter".
  • You will need 10 black&white bitmaps with the digits 0,1,2,3,4,5,6,7,8,9. I used Autodesk Animator and saved as .CEL.
  • In each Sub-Material, put a Diffuse Map using the digit maps. Every time click on the checkered box "Show Bitmap in Viewport". Sub-Material 1 will be for the digit 0, Sub-Material 10 will be for the digit 9.
  • In each Sub-Material, copy the same texture to the Opacity Map slot.
  • In each Sub-Material, set Self-Illum. to 100%.
  • Assign this Material to the right frames digit, to the right seconds digit, and to the right minutes digit rectangles. In Shaded Mode the digit 0 should appear on each rectangle you assigned to.
  • Create two copies of the Material and change the names to "Counter 60" and "Counter 30".
  • Set the number of Sub-Materials to 6 for the first and to 3 for the second.
  • Assign the Material "Counter 60"to the left seconds and minutes digits. This material will display the numbers from 0 to 5.
  • Assign the Material "Counter 30" to the left frame digit.
  • Create a Star Shape somewhere in the scene. We will use the 3rd value (number of star points) to set the desired Frame per Second (FPS) value (since we cannot read the system FPS settings in the Expression Controller.)

    We have now a counter that displays zeros on all positions. We have to change the digits according to the current animation time:

  • Open TrackView and assign an Expression Controller to the Mat.ID track of each Rectangle.
  • Change the Controller Type for the 3rd track of the Star Shape Properties to Linear Float.
  • Enter the following expressions:

    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.
    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.

    Why is it so complex?
    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.

    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
    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.

    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.
    T returns the current time in ticks.
    TPS always returns 4800 ticks/sec.
    floor returns the largest integer smaller than or equal to.

    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
    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.

    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.


    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...

    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...


    Universal SMPTE Counter
    Copyright (c) 1997 by Borislav Petrov