script for cut-paste attributes?

quokka wrote on 5/22/2006, 10:54 PM
Hi all,
New to scripting so maybe this isn't possible even with a script? -
I'm trying to set all the properties of selected .avi clips within Project Media (preferably - or even on the Timeline) to have the same properties but can't seem to get the "use custom timecode" field/values to copy onto selected files using the "Paste Event Attributes" command. (after setting one clips properties to "use custome timecode" and setting it to 00:00:00:00)

We are Video Capturing from DigiBeta to multiple .AVI's using Sony Capture, which imbeds the timecode from the tape into the file, we then need Combustion to match the timecode of edits from Vegas - problem is Combustion(!) recognises the timecode in each .avi as starting from 00:00:00:00 - (not the imbedded tc). So we are trying to get Vegas to change all timecode values to "custom" starting at zero for each clip.

Comments

JohnnyRoy wrote on 5/23/2006, 7:34 AM
> So we are trying to get Vegas to change all timecode values to "custom" starting at zero for each clip.

In the Vegas Script API the Media object has a Boolean attribute called UseCustomTimecode. You want to set this to true. Then there is a property TimecodeIn which you would want to set to zero. Something like this:
/**
* Program: Zero Timecode For All Media.js
*
* This script will set the timecode to zero for all media
* in the project's media pool.
*
* Author: John Rofrano jrofrano at vasst.com
*
* Revision Date: May 23, 2006
**/

import System.Windows.Forms;
import Sony.Vegas;

try
{
var zeroTimecode : Timecode = new Timecode(0); // create a zero timecode
var count : int = 0; // keep a count

// interate over all of the media in the media bin
for (var media : Media in Vegas.Project.MediaPool)
{
media.UseCustomTimecode = true; // use the custom timecode
media.TimecodeIn = zeroTimecode; // and set it to zero
count++; // increment the counter
}

// show how many media items we've processed
MessageBox.Show("Processed (" + count + ") media item(s)");
}
catch (e)
{
MessageBox.Show(e);
}
/** END OF SCRIPT **/
Hope this helps,

~jr
quokka wrote on 5/23/2006, 7:48 PM
A Thousand thankyou's JR. It works a treat!
JohnnyRoy wrote on 5/23/2006, 8:07 PM
Great! Glad I could help.

~jr