So you can't just add the parent track above the "child" tracks you already have? Add a new track above the existing track and then make the existing track a "child" to that new track.
So you can't just add the parent track above the "child" tracks you already have? Add a new track above the existing track and then make the existing track a "child" to that new track.
Actually, if I want some exist tracks that are not adjacent to each other to be child tracks, it is necessary to move the tracks so that they are adjacent to each other.
Actually, if I want some exist tracks that are not adjacent to each other to be child tracks, it is necessary to move the tracks so that they are adjacent to each other.
That would be true. However, it seems it would be faster to just manually move the tracks than to try to have a script figure out which tracks to move.
Finally I decided to create a new Track, and move all track events in original track to new track, then delete original track. That will cause to lose track motion and effects data. I gave them up.
Or how to clone a track, then remove the original track.
If you are simply wanting to copy (clone) a video or audio track within the same project, R click the track header and in the context menu that opens select 'Duplicate Track'. The track will be copied to a new track just below - and all the FX and Track Motion copies as well.
Track.Index is read-only. So how to change the index of an exist track?
I've not heard of the term 'track index' in relation to Vegas Pro's timeline. If you mean that you want to change the vertical order of the tracks, then it's only a matter of highlighting the track header with the mouse and then moving the track up or down (e.g. move track 5 upwards to become track 2).
If you are simply wanting to copy (clone) a video or audio track within the same project, R click the track header and in the context menu that opens select 'Duplicate Track'. The track will be copied to a new track just below - and all the FX and Track Motion copies as well.
Well, I meant using Vegas Script to copy tracks in the Vegas. It's very easy to do this by clicking mouse, but it's hard to do by scripting.
I've not heard of the term 'track index' in relation to Vegas Pro's timeline. If you mean that you want to change the vertical order of the tracks, then it's only a matter of highlighting the track header with the mouse and then moving the track up or down (e.g. move track 5 upwards to become track 2).
"Track.Index" is a Vegas Scripting API, to get the list index of the track. Yes, I just want to change the vertical order of the tracks. But I haven't found a easier way to change it by scripting yet.
I'm in the process of writing an ATEM Mini Pro DRP import for Vegas (resolve format). I have the JSON objects defined and moving along in the coding quite nicely.. and then stuck on such a simple thing.
OpenFile() will add media and insert the new track with media at the TOP of the timeline tracks. (e.g. the last file opened ends up in track position 1, not at the bottom as I'd like it).
The AddVideoTrack() method does the same... does not add the tracks to the bottom, but instead to the top.
I was looking for a simple way to just reorder the tracks, moving the top-most track to the bottom.. and it isn't evident how to accomplish this.
@jetdv's YouTube video posted above was helpful... thank you Ed!
I've run into the same issue in HOS when importing media and adding them to the timeline. Just looked at the API and came up with this code that seems to work OK. For example, if you want to add the new media to Tracks 2 and 3 in the event there is already media in 0 and 1.
var newVidIdx = 2;
var newAudIdx = 3;
var newVidTrack = new VideoTrack(newVidIdx, "Imported Video");
var newAudTrack = new AudioTrack(newAudIdx, "Imported Audio");
vegas.Project.Tracks.Add(newVidTrack);
vegas.Project.Tracks.Add(newAudTrack);
Now you can import media directly to those new tracks. You'll still have to manually add a new trackevent and a new take from the media, but it should work OK. If you need further help, let me know.
@RedRob-CandlelightProdctns, My tutorial shows how to add a video/audio track wherever you want it added. You just have to specify the index where you want it added. The video illustrates tracks being added in any location. Just remember, the "top" is an index of ZERO. Add after the first track is an index of ONE. So you can definitely add the tracks wherever you want them added.
Then, don't use "OpenFile". Instead, manually add the media to the track(s) you just created.
I'm doing this in my VegasStream import script and it all works fine. You can easily specify where to place any new track. Then just load the desired media into the desired track.