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

Cameras: Sony FDR-AX100E; GoPro Hero 11 Black Creator Edition

Installed: Vegas Pro 15, 16, 17, 18, 19, 20, 21 & 22, HitFilm Pro 2021.3, DaVinci Resolve Studio 20, BCC 2025, Mocha Pro 2025.0, NBFX TotalFX 7, Neat NR, DVD Architect 6.0, MAGIX Travel Maps, Sound Forge Pro 16, SpectraLayers Pro 11, iZotope RX11 Advanced and many other iZ plugins, Vegasaur 4.0

Windows 11

Dell Alienware Aurora 11:

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: 2TB Samsung 990 PCIe 4.0 NVMe M.2 PCIe SSD

D: drive: 4TB Samsung 870 SATA SSD (used for media for editing current projects)

E: drive: 2TB Samsung 870 SATA SSD

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

Dell Ultrasharp 32" 4K Color Calibrated Monitor

 

LAPTOP:

Dell Inspiron 5310 EVO 13.3"

i5-11320H CPU

C Drive: 1TB Corsair Gen4 NVMe M.2 2230 SSD (upgraded from the original 500 GB SSD)

Monitor is 2560 x 1600 @ 60 Hz

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!

Last changed by RedRob-CandlelightProdctns on 11/3/2021, 9:04 PM, changed a total of 1 times.

Vegas 21.300

My PC (for finishing):

Cyperpower PC Intel Core i7-7700K CPU @ 4.2GHz, 64GB mem @ 2133MHz RAM, AMD Radeon RX470 (4GB dedicated) with driver recommended by Vegas Updater (reports as 30.0.15021.11005 dated 4/28/22), and Intel HD Graphics 630 driver version 31.0.101.2112 dated 7/21/22 w/16GB shared memory. Windows 10 Pro 64bit version 10.0.19045 Build 19045.

My main editing laptop:

Dell G15 Special Edition 5521, Bios 1.12 9/13/22, Windows 11 22H2 (10.0.22621)

12th Gen Intel Core i7-12700H (14 cores, 20 logical processors), 32 GB DDR5 4800MHz RAM, Intel Iris Xe Graphics, NVIDIA GeForce RTX 3070 Ti Laptop GPU w/8GB GDDR6 RAM, Realtek Audio

 

 

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 RTX4070 graphics card. System 2: Intel i7-3770k with HD 4000 graphics plus an AMD RX550 graphics card. System 3: Laptop. Dell Inspiron Plus 16. Intel i7-11800H, Intel Graphics. Current cameras include Panasonic FZ2500, GoPro Hero11 and Hero8 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!)

Vegas 21.300

My PC (for finishing):

Cyperpower PC Intel Core i7-7700K CPU @ 4.2GHz, 64GB mem @ 2133MHz RAM, AMD Radeon RX470 (4GB dedicated) with driver recommended by Vegas Updater (reports as 30.0.15021.11005 dated 4/28/22), and Intel HD Graphics 630 driver version 31.0.101.2112 dated 7/21/22 w/16GB shared memory. Windows 10 Pro 64bit version 10.0.19045 Build 19045.

My main editing laptop:

Dell G15 Special Edition 5521, Bios 1.12 9/13/22, Windows 11 22H2 (10.0.22621)

12th Gen Intel Core i7-12700H (14 cores, 20 logical processors), 32 GB DDR5 4800MHz RAM, Intel Iris Xe Graphics, NVIDIA GeForce RTX 3070 Ti Laptop GPU w/8GB GDDR6 RAM, Realtek Audio