📝⚙️ (Script) Enable alpha channel. @jetdv HELP ME!

m3lquixd wrote on 2/18/2023, 10:27 AM

I find it too time consuming to execute: Right click on a media>Properties>Media>Alpha Channel and select Premultiplied.
[[MENTION:72365]] Could you make a script to turn selected media on the timeline into alpha channel premultiplied. So I can set a keyboard shortcut for that. Please! Thank you very much in advance!
Ps. I know that there is already a script from The Happy Otter that opens a window to set the alpha channel, but I still have to select which mode I want. And I wanted one that always set Premultiplied.

Last changed by m3lquixd

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

Comments

m3lquixd wrote on 2/18/2023, 10:29 AM

@jetdv I posted publicly and not directly in private, because someone might be interested in that too.

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

juan_rios wrote on 2/18/2023, 12:05 PM

Yes. Myself. And with the kindness of Mr. Troxel, an independent one for "Straight" and "Dirty" would not be bad.

Last changed by juan_rios on 2/18/2023, 12:15 PM, changed a total of 1 times.

PC-ESTUDIO1:

- VEGAS Pro 19 B651.

- Windows 11 64 bits - Intel Core i7 10.700K CPU @ 3.80GHz

- Motherboard Rog Strix 8460-H Gaming - RAM 32GB.

- nVidia GeForce GTX 1650 Super.

- Intel UHD Graphics 630.

PC-ESTUDIO2:

-Shotcut.

-Kdenlive.

-Linux Mint 21.2 -Victoria - Intel Core i5 6.400 CPU @ 2.7GHz

-Motherboard Gigabyte H110M-S2PV DD3 - RAM 16GB

-Intel Graphics 530.

LAPTOP:

-HP Victus 16-e

-VEGAS Pro 19 B651

- Windows 11 64 bits - AMD Ryzen 7 5.800H with Radeon Graphics 3.20 GHz

-GeForce RTX 3050 Laptop GPU

-RAM 16 GB.

CAMERAS:

Panasonic FZ300; FZ1000; FZ2000 and HC X1500.

 

 

jetdv wrote on 2/18/2023, 12:43 PM

Please see this one:

m3lquixd wrote on 2/18/2023, 12:51 PM

@jetdv I don't really understand scripting, if you could create it for us I would be grateful.

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

wwaag wrote on 2/18/2023, 12:53 PM

@m3lquixd

There's a tool in the HOS Free Tools Library that enables you to set alpha for selected events. Here's a screengrab.

And a link to the library where it can be downloaded. https://tools4vegas.com/library/

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.

m3lquixd wrote on 2/18/2023, 12:58 PM

Ps. I know that there is already a script from The Happy Otter that opens a window to set the alpha channel, but I still have to select which mode I want. And I wanted one that always set Premultiplied.


@wwaag Yes I know. I quoted her. But thanks.

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

m3lquixd wrote on 2/18/2023, 12:59 PM

@wwaag btw, I currently use it.

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

wwaag wrote on 2/18/2023, 1:01 PM

@m3lquixd

Sorry. I didn't read your request carefully.

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 2/18/2023, 2:55 PM
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)
                    {
                        if (evnt.Selected)
                        {
                            VideoEvent vEvent = (VideoEvent)evnt;
                            VideoStream vs = (VideoStream)vEvent.ActiveTake.Media.Streams.GetItemByMediaType(MediaType.Video, vEvent.ActiveTake.StreamIndex);
                            vs.AlphaChannel = VideoAlphaType.Premultiplied;
                        }
                    }
                }
            }
        }
    }
}

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

Ok, this one will look through all tracks. Then, if it's a video track, it will look through all events. Then, if the video event is selected, it will convert the track event to a video event, find the video stream, and change the AlphaChannel property of the stream to "Premultiplied".

 

m3lquixd wrote on 2/18/2023, 8:32 PM

Thank you very much, @jetdv!

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

juan_rios wrote on 2/19/2023, 8:37 AM

Thank you! Working here.

PC-ESTUDIO1:

- VEGAS Pro 19 B651.

- Windows 11 64 bits - Intel Core i7 10.700K CPU @ 3.80GHz

- Motherboard Rog Strix 8460-H Gaming - RAM 32GB.

- nVidia GeForce GTX 1650 Super.

- Intel UHD Graphics 630.

PC-ESTUDIO2:

-Shotcut.

-Kdenlive.

-Linux Mint 21.2 -Victoria - Intel Core i5 6.400 CPU @ 2.7GHz

-Motherboard Gigabyte H110M-S2PV DD3 - RAM 16GB

-Intel Graphics 530.

LAPTOP:

-HP Victus 16-e

-VEGAS Pro 19 B651

- Windows 11 64 bits - AMD Ryzen 7 5.800H with Radeon Graphics 3.20 GHz

-GeForce RTX 3050 Laptop GPU

-RAM 16 GB.

CAMERAS:

Panasonic FZ300; FZ1000; FZ2000 and HC X1500.

 

 

juan_rios wrote on 2/19/2023, 8:44 AM

And please jetdv, would it be possible to modify for Straight (unmatted) and Premultiplied (dirty)? Depending on the source, some clips work better with one of these. It would be a great favor.

Last changed by juan_rios on 2/19/2023, 8:45 AM, changed a total of 1 times.

PC-ESTUDIO1:

- VEGAS Pro 19 B651.

- Windows 11 64 bits - Intel Core i7 10.700K CPU @ 3.80GHz

- Motherboard Rog Strix 8460-H Gaming - RAM 32GB.

- nVidia GeForce GTX 1650 Super.

- Intel UHD Graphics 630.

PC-ESTUDIO2:

-Shotcut.

-Kdenlive.

-Linux Mint 21.2 -Victoria - Intel Core i5 6.400 CPU @ 2.7GHz

-Motherboard Gigabyte H110M-S2PV DD3 - RAM 16GB

-Intel Graphics 530.

LAPTOP:

-HP Victus 16-e

-VEGAS Pro 19 B651

- Windows 11 64 bits - AMD Ryzen 7 5.800H with Radeon Graphics 3.20 GHz

-GeForce RTX 3050 Laptop GPU

-RAM 16 GB.

CAMERAS:

Panasonic FZ300; FZ1000; FZ2000 and HC X1500.

 

 

m3lquixd wrote on 2/19/2023, 9:14 AM
                            vs.AlphaChannel = VideoAlphaType.Premultiplied;

@juan_rios I think it's just a matter of modifying this part of the script, I don't understand it very well, but I'll try here

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

m3lquixd wrote on 2/19/2023, 9:20 AM

Thank you! Working here.

@juan_rios I find it very practical to define a shortcut with the keyboard, this script will help me a lot.
Thanks again @jetdv

Last changed by m3lquixd on 2/19/2023, 9:23 AM, changed a total of 2 times.

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

m3lquixd wrote on 2/19/2023, 9:33 AM
                            vs.AlphaChannel = VideoAlphaType.Premultiplied;

@juan_rios I think it's just a matter of modifying this part of the script, I don't understand it very well, but I'll try here


@juan_rios I couldn't do it lol
I don't know what the command is for Straight (unmatted) and Premultiplied (dirty).
I don't know how vegas identifies this internally.

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

juan_rios wrote on 2/19/2023, 10:32 AM

Thanks m3lquixd; I already tried that but it didn't work either. That's why Mr. Troxel's magic is needed.😀

PC-ESTUDIO1:

- VEGAS Pro 19 B651.

- Windows 11 64 bits - Intel Core i7 10.700K CPU @ 3.80GHz

- Motherboard Rog Strix 8460-H Gaming - RAM 32GB.

- nVidia GeForce GTX 1650 Super.

- Intel UHD Graphics 630.

PC-ESTUDIO2:

-Shotcut.

-Kdenlive.

-Linux Mint 21.2 -Victoria - Intel Core i5 6.400 CPU @ 2.7GHz

-Motherboard Gigabyte H110M-S2PV DD3 - RAM 16GB

-Intel Graphics 530.

LAPTOP:

-HP Victus 16-e

-VEGAS Pro 19 B651

- Windows 11 64 bits - AMD Ryzen 7 5.800H with Radeon Graphics 3.20 GHz

-GeForce RTX 3050 Laptop GPU

-RAM 16 GB.

CAMERAS:

Panasonic FZ300; FZ1000; FZ2000 and HC X1500.

 

 

jetdv wrote on 2/19/2023, 1:57 PM

Just pick the one you want to use:

                            vs.AlphaChannel = VideoAlphaType.Premultiplied;
                            vs.AlphaChannel = VideoAlphaType.PremultipliedDirty;
                            vs.AlphaChannel = VideoAlphaType.Straight;
                            vs.AlphaChannel = VideoAlphaType.None;

 

m3lquixd wrote on 2/19/2023, 3:21 PM

Just pick the one you want to use:

                            vs.AlphaChannel = VideoAlphaType.Premultiplied;
                            vs.AlphaChannel = VideoAlphaType.PremultipliedDirty;
                            vs.AlphaChannel = VideoAlphaType.Straight;
                            vs.AlphaChannel = VideoAlphaType.None;

 

Tested and approved!

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

juan_rios wrote on 2/19/2023, 3:57 PM

Fantastic jetdv . Thank you!

Last changed by juan_rios on 2/19/2023, 3:57 PM, changed a total of 1 times.

PC-ESTUDIO1:

- VEGAS Pro 19 B651.

- Windows 11 64 bits - Intel Core i7 10.700K CPU @ 3.80GHz

- Motherboard Rog Strix 8460-H Gaming - RAM 32GB.

- nVidia GeForce GTX 1650 Super.

- Intel UHD Graphics 630.

PC-ESTUDIO2:

-Shotcut.

-Kdenlive.

-Linux Mint 21.2 -Victoria - Intel Core i5 6.400 CPU @ 2.7GHz

-Motherboard Gigabyte H110M-S2PV DD3 - RAM 16GB

-Intel Graphics 530.

LAPTOP:

-HP Victus 16-e

-VEGAS Pro 19 B651

- Windows 11 64 bits - AMD Ryzen 7 5.800H with Radeon Graphics 3.20 GHz

-GeForce RTX 3050 Laptop GPU

-RAM 16 GB.

CAMERAS:

Panasonic FZ300; FZ1000; FZ2000 and HC X1500.

 

 

Steve_Rhoden wrote on 11/5/2023, 9:18 PM

Is it possible were this script can be modified to toggle thru all of the Alpha channel options? "Premultiplied, Straight" etc.

m3lquixd wrote on 11/5/2023, 9:40 PM

@Steve_Rhoden Yes! See my last message in this post.

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))

Steve_Rhoden wrote on 11/6/2023, 6:38 AM

@m3lquixd No, not that..... What i meant by toggling, is that each time you click on the script, it moves to the next alpha channel option. eg: { "press once the channel goes to Premultiplied, press again it goes to straight" } etc.

jetdv wrote on 11/6/2023, 8:23 AM

Yes, that is possible. You just need to read which one it's currently set to and then set it to the next one. Take a look at this tutorial which "rotates" the video counter-clockwise to the next position each time. You would do the same thing except go through the four different alpha modes.

m3lquixd wrote on 11/6/2023, 1:35 PM

@Steve_Rhoden I liked it, it's a really good idea!
It would be cool for you to do that @jetdv.

About me:
Hi! Melqui Calheiros Here. I've been using Vegas as my only video editor for over 10 years. I edit professionally for various influencers, public bodies and small businesses. My goal is to squeeze Vegas to the fullest! And end the prejudice that software has here in Brazil.

⬇️ Some of my jobs. ⬇️
https://www.vegascreativesoftware.info/us/forum/post-your-vegas-creations--109464/?page=37#ca872169

PC Specs:
Operating System:
    Windows 11 Pro 64-bit
CPU:
    AMD Ryzen 3 3200G 3.60 GHz
RAM:
    32,0GB Dual-Channel DDR4 2666MHz
Motherboard:
    BIOSTAR Group B450MX-S (AM4)
Graphics:
    4095MB NVIDIA GeForce GTX 1650 (ZOTAC International)
Storage:
    465GB Seagate ST500DM002-1BD142 (SATA )
    238GB Lexar 256GB SSD (SATA (SSD))
  931GB KINGSTON SNV2S1000G (SATA-2 (SSD))