Hello,
I want to chagne the Vegas Import XML script that comes bundled with it to allow grouping of track events. At the moment if you have some tracks that are grouped and then export the xml (using the Vegas script) and then re-import them (using the vegas script) you lose the grouping. At the moment I have chagned the following code but I get an Cast Error
In Import Track Event I have added the *********** lines
==========================================================
function ImportTrackEvent(parent : XmlElement, events : TrackEvents) {
var trackEvent : TrackEvent = null;
var audioEvent : AudioEvent = null;
var videoEvent : VideoEvent = null;
//set up variable for groups
var allGroups : TrackEventGroups = Vegas.Project.Groups; *************
if (parent.Name == "AudioEvent") {
audioEvent = new AudioEvent();
trackEvent = TrackEvent(audioEvent);
} else if (parent.Name == "VideoEvent") {
videoEvent = new VideoEvent();
trackEvent = TrackEvent(videoEvent);
}
events.Add(trackEvent);
.................
all try/catch clauses etc here.....
..........................
//if got audioEvent then add to group
if (audioEvent != null) ***********
allGroups.Add(audioEvent); ***********
//if got video event then add to group
if (videoEvent != null) *************
allGroups.Add(videoEvent); *************
}
I get a cast exception. If I comment out the audioEvent then the script runs but the groups arent set.
Can anyone help me set this up
Thanks
Richard
I want to chagne the Vegas Import XML script that comes bundled with it to allow grouping of track events. At the moment if you have some tracks that are grouped and then export the xml (using the Vegas script) and then re-import them (using the vegas script) you lose the grouping. At the moment I have chagned the following code but I get an Cast Error
In Import Track Event I have added the *********** lines
==========================================================
function ImportTrackEvent(parent : XmlElement, events : TrackEvents) {
var trackEvent : TrackEvent = null;
var audioEvent : AudioEvent = null;
var videoEvent : VideoEvent = null;
//set up variable for groups
var allGroups : TrackEventGroups = Vegas.Project.Groups; *************
if (parent.Name == "AudioEvent") {
audioEvent = new AudioEvent();
trackEvent = TrackEvent(audioEvent);
} else if (parent.Name == "VideoEvent") {
videoEvent = new VideoEvent();
trackEvent = TrackEvent(videoEvent);
}
events.Add(trackEvent);
.................
all try/catch clauses etc here.....
..........................
//if got audioEvent then add to group
if (audioEvent != null) ***********
allGroups.Add(audioEvent); ***********
//if got video event then add to group
if (videoEvent != null) *************
allGroups.Add(videoEvent); *************
}
I get a cast exception. If I comment out the audioEvent then the script runs but the groups arent set.
Can anyone help me set this up
Thanks
Richard