Is there easy way to cut overlapping clips from different tracks

MarkAnthony121 wrote on 2/4/2025, 4:17 PM

There could be multiple solutions to this. I want the right side to be but the way the left side is:

The reason for doing this? When rendering for some reason leaving all the clips overlapping slows the render to 1/3 of where it should be. It also caused huge instability when rendering large 2 hour projects. It's not a VP22 thing, it was happening in VP21. So #1, is there a reason the render is slowing down? (remember it doesn't slow down if there's no clips underneath each other) Because I'd prefer that solution. OR #2 is there a way to flatten/merge or even automatically cut them? I've been slicing manually for the past year but I'm wondering if there's a better way.

Comments

jetdv wrote on 2/5/2025, 8:56 AM

So you want everything under another event to be removed? This could certainly be done with a script but there's no "built-in" method that I'm aware of. I'll have to look at creating a tutorial for this.

It would be helpful to see the track headers in this image.

relaxvideo wrote on 2/5/2025, 9:51 AM

yes, sadly vegas calculate all the lower tracks with all fx even when the topmost will cover all of them!!

thats a long time request from me, but not available :(

even our hard disk, ssd works harder, reading all those files..

i understand that the topmost track maybe has an even pan/crop, so what is under it should be visible. or can have composition mode other than source alpha, so in this case bottom tracks should be calculated.

but in op's situation only the topmost track should be calculated +audio of course.

#1 Ryzen 5-1600, 16GB DDR4, Nvidia 1660 Super, M2-SSD, Acer freesync monitor

#2 i7-2600, 32GB, Nvidia 1660Ti, SSD for system, M2-SSD for work, 2x4TB hdd, LG 3D monitor +3DTV +3D projectors

Win10 x64, Vegas22 latest

Howard-Vigorita wrote on 2/6/2025, 8:49 AM

@MarkAnthony121 Looks like you shot with multiple cameras and split the left-side manually and then deleted the angles you didn't want. If you use multicam edit mode to create a multicam track to do the splits, it'll give you the option to delete the angles not wanted upon expansion back to the original camera tracks. The other multicam option is to keep the unwanted angles and Mute them in clip properties. I don't see any difference in render performance between those 2 options when I render but usually drop the unwanted splits to make the project less cluttered. You could use the same approach without using multicam edit mode by aligning the cursor on the beginnings and ends of clips you want and splitting all the clips below them. Then deleting or muting the ones you don't want. If you go the less tedious multicam-edit route, be aware that it drops track fx when it merges camera tracks into a single multicam track. So if you've already done allot of fx and grading, you should save each track's fx to a preset or filter-package before going into multicam-edit mode. That way you can restore fx after expansion back to the original tracks. My preferred workflow is to do fx and grading after multicam splitting and expansion.

MarkAnthony121 wrote on 2/6/2025, 12:35 PM

Yes sir, I've considered doing that however these edits are so very basic and I effectively make 90% of my cuts in cam with how I shoot. Basically once I sync with Syncaila and import the XML into Vegas as long as my A cam is the top track it's just about done and ready to render. So doing it multicam style would create way more work. It's already very fast. Just wanted to see if there was a way to save 10 minutes of trimming. Not a huge deal at all :) And yes I wouldn't even bother with this if it didn't slow the render or cause instability. By the way did you ever figure out a way to reasonably use CRM or convert for Vegas? I was planning on buying a c80 but either I don't use raw and lose out on cam capabilities, or I start using premiere so I can actually import CRM files. (saw you talking about this a year ago in another post)

jetdv wrote on 2/6/2025, 2:02 PM

@MarkAnthony121, I'll work on a script that will do that for you...

MarkAnthony121 wrote on 2/6/2025, 2:04 PM

@MarkAnthony121, I'll work on a script that will do that for you...

Aw you don't have to do that! I'd legit donate though if you made something that would save me those extra 15 minutes for max efficiency. Very kind of you to even consider that.

Howard-Vigorita wrote on 2/6/2025, 3:18 PM

... I was planning on buying a c80 but either I don't use raw and lose out on cam capabilities, or I start using premiere so I can actually import CRM files. (saw you talking about this a year ago in another post)

Saw your other post 1st and answered it there. Looked at the c80 myself but I'm still learning the c70 which I'm very impressed with. They both take advantage of an rf lens which accommodates a zoom-motor add-on that effectively turns a c70 or c80 into a camcorder on steroids. I got the c70 with a 24-105 f2.8 and can control it via the camera's lanc port just like an xf605 which I also use. Got the new limited supply 70-200 lens on order which is otherwise identical and also takes a 2x extender.

MarkAnthony121 wrote on 2/6/2025, 3:25 PM

... I was planning on buying a c80 but either I don't use raw and lose out on cam capabilities, or I start using premiere so I can actually import CRM files. (saw you talking about this a year ago in another post)

Saw your other post 1st and answered it there. Looked at the c80 myself but I'm still learning the c70 which I'm very impressed with. They both take advantage of an rf lens which accommodates a zoom-motor add-on that effectively turns a c70 or c80 into a camcorder on steroids. I got the c70 with a 24-105 f2.8 and can control it via the camera's lanc port just like an xf605 which I also use. Got the new limited supply 70-200 lens on order which is otherwise identical and also takes a 2x extender.

Both great cams. I just feel bad not fully utilizing the c80's full frame/6K/12 bit shooting and I just don't have the time/effort to learn something like Premiere that can take CRM files. Plus Vegas is MUCH faster for cutting. I'm still thinking about it. Or getting a Sony cam

jetdv wrote on 2/8/2025, 9:30 AM

@MarkAnthony121 - Try this:
 

using System;
using System.Collections.Generic;
using System.Collections;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Drawing;
using System.Runtime;
using System.Xml;
using ScriptPortal.Vegas;

namespace Test_Script
{
    public class Class1
    {
        public Vegas myVegas;

        public void Main(Vegas vegas)
        {
            myVegas = vegas;

            foreach (Track myTrack in myVegas.Project.Tracks)
            {
                if (myTrack.IsVideo())
                {
                    foreach(TrackEvent evnt in myTrack.Events)
                    {
                        RemoveSectionBelow(evnt, myTrack.Index);
                    }
                }
            }
        }

        public void RemoveSectionBelow(TrackEvent evnt, int CurrentIndex)
        {
            Timecode AreaStart = evnt.Start;
            Timecode AreaEnd = evnt.End;

            for(int i=CurrentIndex + 1; i<myVegas.Project.Tracks.Count; i++)
            {
                Track thisTrack = myVegas.Project.Tracks[i];
                
                for (int j =thisTrack.Events.Count - 1; j >=0; j--)
                {
                    TrackEvent UnderArea = null;
                    TrackEvent tEvent = thisTrack.Events[j];
                    //MessageBox.Show("Track " + i + "  Event " + j + "   " + tEvent.Start + "vs" + AreaStart + "   " + tEvent.End + "vs" + AreaStart);
                    if (tEvent.Start == AreaStart || (tEvent.Start < AreaEnd && tEvent.End >= AreaEnd))
                    {
                        UnderArea = tEvent;
                    }
                    if (tEvent.Start < AreaStart && tEvent.End >= AreaStart)
                    {
                        UnderArea = tEvent.Split(AreaStart - tEvent.Start);
                    }
                    if (UnderArea != null)
                    {
                        tEvent = UnderArea;
                        //MessageBox.Show(tEvent.Start + "vs" + AreaEnd + "   " + tEvent.End + "vs" + AreaEnd);

                        if (tEvent.Start <= AreaEnd && tEvent.End > AreaEnd)
                        {
                            UnderArea = tEvent.Split(AreaEnd - tEvent.Start);
                        }
                    }
                    if (UnderArea != null)
                    {
                        thisTrack.Events.Remove(tEvent);
                    }
                }
            }
        }

    }
}

public class EntryPoint
{
    public void FromVegas(Vegas vegas, string scriptFile, XmlDocument scriptSettings, ScriptArgs args)
    {
        Test_Script.Class1 test = new Test_Script.Class1();
        test.Main(vegas);
    }
}

 

jetdv wrote on 2/8/2025, 1:16 PM

Please use this one instead as it will only cut information out of video tracks and ignore audio tracks:
 

using System;
using System.Collections.Generic;
using System.Collections;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Drawing;
using System.Runtime;
using System.Xml;
using ScriptPortal.Vegas;

namespace Test_Script
{
    public class Class1
    {
        public Vegas myVegas;

        public void Main(Vegas vegas)
        {
            myVegas = vegas;

            foreach (Track myTrack in myVegas.Project.Tracks)
            {
                if (myTrack.IsVideo())
                {
                    foreach(TrackEvent evnt in myTrack.Events)
                    {
                        RemoveSectionBelow(evnt, myTrack.Index);
                    }
                }
            }
        }

        public void RemoveSectionBelow(TrackEvent evnt, int CurrentIndex)
        {
            Timecode AreaStart = evnt.Start;
            Timecode AreaEnd = evnt.End;

            for(int i=CurrentIndex + 1; i<myVegas.Project.Tracks.Count; i++)
            {
                Track thisTrack = myVegas.Project.Tracks[i];
                if (thisTrack.IsVideo())
                {
                    for (int j = thisTrack.Events.Count - 1; j >= 0; j--)
                    {
                        TrackEvent UnderArea = null;
                        TrackEvent tEvent = thisTrack.Events[j];
                        //MessageBox.Show("Track " + i + "  Event " + j + "   " + tEvent.Start + "vs" + AreaStart + "   " + tEvent.End + "vs" + AreaStart);
                        if (tEvent.Start == AreaStart || (tEvent.Start < AreaEnd && tEvent.End >= AreaEnd))
                        {
                            UnderArea = tEvent;
                        }
                        if (tEvent.Start < AreaStart && tEvent.End >= AreaStart)
                        {
                            UnderArea = tEvent.Split(AreaStart - tEvent.Start);
                        }
                        if (UnderArea != null)
                        {
                            tEvent = UnderArea;
                            //MessageBox.Show(tEvent.Start + "vs" + AreaEnd + "   " + tEvent.End + "vs" + AreaEnd);

                            if (tEvent.Start <= AreaEnd && tEvent.End > AreaEnd)
                            {
                                UnderArea = tEvent.Split(AreaEnd - tEvent.Start);
                            }
                        }
                        if (UnderArea != null)
                        {
                            thisTrack.Events.Remove(tEvent);
                        }
                    }
                }
            }
        }

    }
}

public class EntryPoint
{
    public void FromVegas(Vegas vegas)
    {
        Test_Script.Class1 test = new Test_Script.Class1();
        test.Main(vegas);
    }
}

 

MarkAnthony121 wrote on 2/8/2025, 1:19 PM

Please use this one instead as it will only cut information out of video tracks and ignore audio tracks:
 

using System;
using System.Collections.Generic;
using System.Collections;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Drawing;
using System.Runtime;
using System.Xml;
using ScriptPortal.Vegas;

namespace Test_Script
{
    public class Class1
    {
        public Vegas myVegas;

        public void Main(Vegas vegas)
        {
            myVegas = vegas;

            foreach (Track myTrack in myVegas.Project.Tracks)
            {
                if (myTrack.IsVideo())
                {
                    foreach(TrackEvent evnt in myTrack.Events)
                    {
                        RemoveSectionBelow(evnt, myTrack.Index);
                    }
                }
            }
        }

        public void RemoveSectionBelow(TrackEvent evnt, int CurrentIndex)
        {
            Timecode AreaStart = evnt.Start;
            Timecode AreaEnd = evnt.End;

            for(int i=CurrentIndex + 1; i<myVegas.Project.Tracks.Count; i++)
            {
                Track thisTrack = myVegas.Project.Tracks[i];
                if (thisTrack.IsVideo())
                {
                    for (int j = thisTrack.Events.Count - 1; j >= 0; j--)
                    {
                        TrackEvent UnderArea = null;
                        TrackEvent tEvent = thisTrack.Events[j];
                        //MessageBox.Show("Track " + i + "  Event " + j + "   " + tEvent.Start + "vs" + AreaStart + "   " + tEvent.End + "vs" + AreaStart);
                        if (tEvent.Start == AreaStart || (tEvent.Start < AreaEnd && tEvent.End >= AreaEnd))
                        {
                            UnderArea = tEvent;
                        }
                        if (tEvent.Start < AreaStart && tEvent.End >= AreaStart)
                        {
                            UnderArea = tEvent.Split(AreaStart - tEvent.Start);
                        }
                        if (UnderArea != null)
                        {
                            tEvent = UnderArea;
                            //MessageBox.Show(tEvent.Start + "vs" + AreaEnd + "   " + tEvent.End + "vs" + AreaEnd);

                            if (tEvent.Start <= AreaEnd && tEvent.End > AreaEnd)
                            {
                                UnderArea = tEvent.Split(AreaEnd - tEvent.Start);
                            }
                        }
                        if (UnderArea != null)
                        {
                            thisTrack.Events.Remove(tEvent);
                        }
                    }
                }
            }
        }

    }
}

public class EntryPoint
{
    public void FromVegas(Vegas vegas)
    {
        Test_Script.Class1 test = new Test_Script.Class1();
        test.Main(vegas);
    }
}

 

Finishing a project right now so I'll test it within the hour

MarkAnthony121 wrote on 2/8/2025, 4:09 PM

@MarkAnthony121, I'll work on a script that will do that for you...

My god it worked flawlessly. I wish I knew of this a year ago! Is your website still up to date for donations? I'd love to drop something even a little. I was also curious if a script is possible for trimming the first and last frame of every clip in a project? I'm not sure if it happens when I import clips into Vegas, or after I import an XML from Syncaila after synchronizing, but often times I have clips with tiny little overhangs and it's a noticeable little clip if it ends up in the video (has something to do with maybe different frame rates mixed, I don't know). But what you did and the front/end clip trimming are probably my biggest time wasters that I feel could be automated.

jetdv wrote on 2/9/2025, 7:16 AM

@MarkAnthony121, unfortunately the "donate" button isn't working at the moment. I need to go into Paypal and see what's happening there. Apparently I need some other kind of account?

Glad to hear it worked for you. It's probably not the "most efficient" method but will certainly do what you requested.

Yes it is possible to also trim the first and last frame. Last frame is simple, just change the length to length - 1 frame. To do both front and back, I'd change the offset to offset + 1 frame and then take the length to length - 2 frames. Maybe something like this? This will work on ALL SELECTED events - video and audio.

using System;
using System.Collections.Generic;
using System.Collections;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Drawing;
using ScriptPortal.Vegas;

namespace Test_Script
{
    public class Class1
    {
        public Vegas myVegas;

        public void Main(Vegas vegas)
        {
            myVegas = vegas;

            foreach (Track myTrack in myVegas.Project.Tracks)
            {
                foreach (TrackEvent evnt in myTrack.Events)
                {
                    if (evnt.Selected)
                    {
                        evnt.ActiveTake.Offset = evnt.ActiveTake.Offset + Timecode.FromFrames(1);
                        evnt.Length = evnt.Length - Timecode.FromFrames(2);
                    }
                }
            }
        }
    }
}

public class EntryPoint
{
    public void FromVegas(Vegas vegas)
    {
        Test_Script.Class1 test = new Test_Script.Class1();
        test.Main(vegas);
    }
}

 

iEmby wrote on 2/9/2025, 11:11 AM

or you can also try

Mute Hidden Events / Delete Hidden Events.

from this toolkit.

https://www.vegascreativesoftware.info/us/forum/free-toolkit-for-all-users-please-give-feedback--146111/?page=1

Create Backup of Your Project (I case of unnecessary results)..

PROCESSOR
     

Operating System: Windows 11 Pro 64-bit (Always Updated)
System Manufacturer: ASUS
12th Gen Intel(R) Core(TM) i7-12700 (20 CPUs), ~2.1GHz - 4.90GHz
Memory: 32GB RAM
Page File: 11134MB used, 7934MB Available
DirectX Version: DirectX 12

-----------------------------------------------

MOTHERBOARD

 

ASUS PRIME H610-CS D4
Intel® H610 (LGA 1700)
Ready for 12th Gen Intel® Processors
Micro-ATX Motherboard with DDR4
Realtek 1 Gb Ethernet
PCH Heatsink
PCIe 4.0 | M.2 slot (32Gbps) 
HDMI® | D-Sub | USB 3.2 Gen 1 ports
SATA 6 Gbps | COM header
LPT header | TPM header
Luminous Anti-Moisture Coating
5X Protection III
(Multiple Hardware Safeguards
For all-round protection)

-----------------------------------------------
EXTERNAL GRAPHIC CARD

-----------------------------------------------

INTERNAL GRAPHIC CARD (iGPU)

------------------------------------------------

LED - MONITOR

Monitor Name: Generic PnP Monitor
Monitor Model: HP 22es
Monitor Id: HWP331B
Native Mode: 1920 x 1080(p) (60.000Hz)
Output Type: HDMI

-----------------------------------------------

STORAGE DRIVE

Drive: C:
Free Space: 182.3 GB
Total Space: 253.9 GB
File System: NTFS
Model: WD Blue SN570 1TB (NVMe)

---------------O----------------

My System Info (PDF File).

https://drive.google.com/open?id=1-eoLmuXzshTRH_8RunAYAuNocKpiLoiV&usp=drive_fs

 

Also Check

VEGAS Scripts Collection By Me

GitHub Profile

My YouTube Channel Dedicated to Only VEGAS Pro Tutorials

EDITROOM : My YouTube Channel (For VEGAS Tutorials)

MarkAnthony121 wrote on 2/10/2025, 9:38 PM

or you can also try

Mute Hidden Events / Delete Hidden Events.

from this toolkit.

https://www.vegascreativesoftware.info/us/forum/free-toolkit-for-all-users-please-give-feedback--146111/?page=1

Create Backup of Your Project (I case of unnecessary results)..

I'll check it out

MarkAnthony121 wrote on 2/10/2025, 9:38 PM

@MarkAnthony121, unfortunately the "donate" button isn't working at the moment. I need to go into Paypal and see what's happening there. Apparently I need some other kind of account?

Glad to hear it worked for you. It's probably not the "most efficient" method but will certainly do what you requested.

Yes it is possible to also trim the first and last frame. Last frame is simple, just change the length to length - 1 frame. To do both front and back, I'd change the offset to offset + 1 frame and then take the length to length - 2 frames. Maybe something like this? This will work on ALL SELECTED events - video and audio.

using System;
using System.Collections.Generic;
using System.Collections;
using System.IO;
using System.Text;
using System.Windows.Forms;
using System.Globalization;
using System.Drawing;
using ScriptPortal.Vegas;

namespace Test_Script
{
    public class Class1
    {
        public Vegas myVegas;

        public void Main(Vegas vegas)
        {
            myVegas = vegas;

            foreach (Track myTrack in myVegas.Project.Tracks)
            {
                foreach (TrackEvent evnt in myTrack.Events)
                {
                    if (evnt.Selected)
                    {
                        evnt.ActiveTake.Offset = evnt.ActiveTake.Offset + Timecode.FromFrames(1);
                        evnt.Length = evnt.Length - Timecode.FromFrames(2);
                    }
                }
            }
        }
    }
}

public class EntryPoint
{
    public void FromVegas(Vegas vegas)
    {
        Test_Script.Class1 test = new Test_Script.Class1();
        test.Main(vegas);
    }
}

 

Thanks so much again and let me know if you fix the donate option :)

ac6000cw wrote on 2/11/2025, 3:43 AM

There's also a couple of free Happy Otter scripts that do removal or muting of hidden portions of events on lower tracks.

Split events and remove hidden portions: https://tools4vegas.com/removehiddenevents/

Split events and mute hidden portions: https://tools4vegas.com/mutehiddenevents/