Determine whether a particular plugin is present in the chain

Jack S wrote on 2/18/2023, 8:24 AM

@jetdv Hi Edward. Your thoughts on this please.

I'm trying to determine whether a particular plugin is present in an event's plugin chain.
According to the API, the function VideoEvent.Effects.Contains(PlugInNode) should return a boolean indicating
whether PlugInNode is present in the chain. I can't get this to work. The bit of code I'm using is this:-

bool AlreadyApplied = True;
Effect effect = new Effect(plugin); //plugin is class PlugInNode obtained earlier in the script
AlreadyApplied = VideoEvent.Effects.Contains(effect);

This doesn't seem to return the result I expect. Am I missing something?

Thanks in advance.

My system
Genshin Infinity Gaming PC
Motherboard Gigabyte H610M H: m-ATX w/, USB 3.2, 1 x M.2
Power Supply Corsair RM750X
Intel Core i7-13700K - 16-Core [8P @ 3.4GHz-5.4GHz / 8E @ 2.50GHz-4.20GHz]
30MB Cache + UHD Graphics, Ultimate OC Compatible
Case Fan 4 x CyberPowerPC Hyperloop 120mm ARGB & PWM Fan Kit
CPU Fan CyberPowerPC Master Liquid LITE 360 ARGB AIO Liquid Cooler, Ultimate OC Compatible
Memory 32GB (2 x 16GB) DDR5/5200MHz Corsair Vengeance RGB
MSI GeForce RTX 4060 Ti 8GB - Ray Tracing Technology, DX12, VR Ready, HDMI, DP
System drive 1TB WD Black SN770 M.2 NVMe PCIe SSD - 5150MB/s Read & 4900MB/s Write
Storage 2 x 2TB Seagate BarraCuda SATA-III 6.0Gb/s 7200RPM
Windows 11 Home (x64)

Camcorder
SONY Handycam HDR-XR550VE

Comments

jetdv wrote on 2/18/2023, 8:37 AM

I would probably just go through the events and see if the one I'm looking for is there:
 

            string effID = "{Svfx:com.vegascreativesoftware:hsladjust}";
//in your case:
effID = plugin.UniqueID;

            VideoEvent vEvnt = (VideoEvent)myVegas.Project.Tracks[0].Events[0];

            bool found = false;
            foreach(Effect effect in vEvnt.Effects)
            {
                if (effect.PlugIn.UniqueID == effID)
                {
                    found = true;
                    break;
                }
            }

            if (found)
            {
                MessageBox.Show("Effect was found");
            }

I agree it appears what you're doing should work unless it has to be an "exact" match - i.e. do all effect settings have to match? I'm sure this routine would work, though.

Jack S wrote on 2/18/2023, 8:48 AM

I've integrated a batch video stabilisation script into my custom command. I've managed to determine where in the plugin chain it is so that I can apply the analysis and complete the process. That works fine. The problem is, I want to test for the stabilisation plugin being already present in the chain. If it is, I will assume that this has already been applied and will bypass this event.
Your code should do the trick. I'll incorporate it into my code block and let you know.
Thanks.

My system
Genshin Infinity Gaming PC
Motherboard Gigabyte H610M H: m-ATX w/, USB 3.2, 1 x M.2
Power Supply Corsair RM750X
Intel Core i7-13700K - 16-Core [8P @ 3.4GHz-5.4GHz / 8E @ 2.50GHz-4.20GHz]
30MB Cache + UHD Graphics, Ultimate OC Compatible
Case Fan 4 x CyberPowerPC Hyperloop 120mm ARGB & PWM Fan Kit
CPU Fan CyberPowerPC Master Liquid LITE 360 ARGB AIO Liquid Cooler, Ultimate OC Compatible
Memory 32GB (2 x 16GB) DDR5/5200MHz Corsair Vengeance RGB
MSI GeForce RTX 4060 Ti 8GB - Ray Tracing Technology, DX12, VR Ready, HDMI, DP
System drive 1TB WD Black SN770 M.2 NVMe PCIe SSD - 5150MB/s Read & 4900MB/s Write
Storage 2 x 2TB Seagate BarraCuda SATA-III 6.0Gb/s 7200RPM
Windows 11 Home (x64)

Camcorder
SONY Handycam HDR-XR550VE

Jack S wrote on 2/18/2023, 9:57 AM

With a bit of modification to suit my code block, this has done the trick. I'm going to test it thoroughly using different combinations, but it's looking good at the moment. Thanks Edward.

My system
Genshin Infinity Gaming PC
Motherboard Gigabyte H610M H: m-ATX w/, USB 3.2, 1 x M.2
Power Supply Corsair RM750X
Intel Core i7-13700K - 16-Core [8P @ 3.4GHz-5.4GHz / 8E @ 2.50GHz-4.20GHz]
30MB Cache + UHD Graphics, Ultimate OC Compatible
Case Fan 4 x CyberPowerPC Hyperloop 120mm ARGB & PWM Fan Kit
CPU Fan CyberPowerPC Master Liquid LITE 360 ARGB AIO Liquid Cooler, Ultimate OC Compatible
Memory 32GB (2 x 16GB) DDR5/5200MHz Corsair Vengeance RGB
MSI GeForce RTX 4060 Ti 8GB - Ray Tracing Technology, DX12, VR Ready, HDMI, DP
System drive 1TB WD Black SN770 M.2 NVMe PCIe SSD - 5150MB/s Read & 4900MB/s Write
Storage 2 x 2TB Seagate BarraCuda SATA-III 6.0Gb/s 7200RPM
Windows 11 Home (x64)

Camcorder
SONY Handycam HDR-XR550VE

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

😁