Add Timecode To All Media.cs help

ChristoC wrote on 10/21/2007, 8:19 AM
I can see the "Add Timecode To All Media" and "Remove Timecode From All Media" being very useful global scripts - however the default T/C format is SMPTE Drop (29.97 fps).

I'm almost always working with SMPTE EBU (25 fps), so I'm wondering if anybody can help me edit the script (with Notepad) to achieve that - I already worked out that I can make a copy of "Add Timecode To All Media.cs" and re-name it "Add 25fr Timecode To All Media.cs" but I'm stumped thereafter....

Also, for single clips (rather than the global above) does anybody know how to make the Video FX - "Sony Timecode" always set itself to the same Timecode format as the Project Properties? - the default is always SMPTE Drop (29.97 fps, Video) which is a real trap for the unwary.

Thanks in advance.

Comments

JohnnyRoy wrote on 10/22/2007, 4:35 AM
It's more than just editing the script. There is no preset for SMPTE EBU (25 fps) so first you would have to create a preset in the Vegas Timecode FX and save it under some name. (e.g., "SMPTE EBU (25 fps)")

Then uncomment line 21 by removing the "//" in front of it:

//String presetName = "SMPTE Drop (29.97 fps)";
becomes:

String presetName = "SMPTE Drop (29.97 fps)";
and change it to the preset name that you want:

String presetName = "SMPTE EBU (25 fps)";

The preset name must match exactly what's in the Timecode format dropdown of the FX.

There is no easy way to have it default to the format of the project because the formats of the timeline ruler in the script API do not match the names of the presets and, as you have seen, not all of the ruler formats have presets. You would have to create presets for the remainder of the formats and then create a hashtable of values to match them up with the value from the ruler so that you could set the preset name correctly.

~jr
ChristoC wrote on 10/22/2007, 5:00 AM
Thanks a million Johnny; that works a treat.

BTW also had to comment out the preceding line 20 i.e.
// String presetName = null;

Christo

JohnnyRoy wrote on 10/23/2007, 4:50 AM
> BTW also had to comment out the preceding line 20 i.e.
> // String presetName = null;

Yes, my bad. You need to comment the preceding one and uncomment the next. Alternately you could just change the null to the preset you want. Anyway you get the idea. Glad it worked out for you.

~jr