Comments

walter-i. wrote on 10/5/2021, 2:24 PM

This could be your first adress:
https://www.vegascreativesoftware.info/us/forum/ever-asked-how-do-i-write-scripts-in-vegas-here-s-your-answer--127310/

jetdv wrote on 10/5/2021, 3:52 PM

You can definitely add a new track anywhere you wish it to be:

http://www.jetdv.com/2021/08/23/add-new-tracks-to-the-timeline-in-vegas-pro/

I've honestly never tried to "move" a track. However, you could add a track, move everything to that new track, and then remove the original track.

william-j wrote on 10/5/2021, 5:01 PM

You can definitely add a new track anywhere you wish it to be:

http://www.jetdv.com/2021/08/23/add-new-tracks-to-the-timeline-in-vegas-pro/

I've honestly never tried to "move" a track. However, you could add a track, move everything to that new track, and then remove the original track.

Yes, I tried adding a track, and move all track events to new track. But then it's hard to move things like track effects or track motion.

I tried doing like `vegas.Project.Tracks.Insert(1, vegas.Project.Tracks[2]);`, but I failed.

I just want to add a compositing parent track, and move some exist tracks to its compositing child tracks, I think it's difficult to do.

jetdv wrote on 10/6/2021, 6:20 AM

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.

william-j wrote on 10/6/2021, 9:37 AM

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.

jetdv wrote on 10/6/2021, 4:05 PM

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.

william-j wrote on 10/7/2021, 2:28 PM

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.

jetdv wrote on 10/7/2021, 4:42 PM

That will cause to lose track motion and effects data. I gave them up.

Those can actually be copied too...

william-j wrote on 10/8/2021, 4:43 AM

Those can actually be copied too...

Yes, but it's troublesome.

I found a ready-made copy track method here (vars.CopyVideoTrack), but he didn't show its code.

https://www.vegascreativesoftware.info/us/forum/putting-an-existing-videotrack-into-a-trackgroup--126477/#ca787189

 

Dexcon wrote on 10/8/2021, 5:00 AM

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

Dell Alienware Aurora 11

Windows 10 Home

10th Gen Intel i9 10900KF - 10 cores (20 threads) - 3.7 to 5.3 GHz

NVIDIA GeForce RTX 2080 SUPER 8GB GDDR6 - liquid cooled

64GB RAM - Dual Channel HyperX FURY DDR4 XMP at 3200MHz

C drive: 1TB M.2 PCIe NVMe SSD

D drive: 6TB WD 7200 rpm Black HDD 3.5"

E & F drives: 2 x 2TB Barracuda HDDs 2.5"

 

william-j wrote on 10/8/2021, 8:47 AM

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.

jetdv wrote on 10/8/2021, 8:55 AM

I'll have to research this when I get a little more time to see what's possible. I've never needed to do this up to this point in time.

william-j wrote on 10/8/2021, 10:03 AM

I'll have to research this when I get a little more time to see what's possible. I've never needed to do this up to this point in time.

OK. Thank you!

RedRob-CandlelightProdctns wrote on 11/3/2021, 8:57 PM

I'm in the same boat.

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!

wwaag wrote on 11/3/2021, 10:19 PM

@RedRob-CandlelightProdctns

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.

Last changed by wwaag on 11/3/2021, 10:22 PM, changed a total of 1 times.

AKA the HappyOtter at https://tools4vegas.com/. System 1: Intel i7-8700k with HD 630 graphics plus an Nvidia 1050ti graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. Current cameras include Panasonic FZ2500, GoPro Hero5 Black plus a myriad of smartPhone, pocket cameras, video cameras and film cameras going back to the original Nikon S.

jetdv wrote on 11/4/2021, 9:23 AM

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

RedRob-CandlelightProdctns wrote on 11/4/2021, 9:31 AM

Yup. Like I wrote, @jetdv your video was most helpful and got me over that hump (thank you!)