How to make scripts compatible with older versions of MAGIX Vegas?

william-j wrote on 2/27/2022, 3:32 AM

I've written a script that works fine on Vegas 17 and above. I know that Vegas 13 and below use a different namespace so that not supported, so I was claiming that the script would work fine on Vegas 14~19.

After I posted the script, a guy was using Vegas 15 and found that my script didn't work properly. He showed me the error details, which showed: "The type or namespace name 'ElastiqueStretchAttributes, ClassicStretchAttributes, TimeStretchPitchShift' could not be found." I know these classes work fine in my Vegas latest version. But I don't know that they don't work on those versions.

So how do I know which versions can use these (or other) classes, and decide which versions to use it in? I don't have older versions of Vegas. I want to check the versions directly in the script, instead of writing separate scripts for those versions.

The exception cannot be caught by "try catch" because it is a reference error.

Comments

Dexcon wrote on 2/27/2022, 4:01 AM

While I can't assist on the scripting issue, I can give a bit of background that may be relevant. Vegas Pro 17 saw some coding changes in its engine that updated, I believe, some coding references from Sony to Vegas. This most notably meant at the time that FXHome's Ignite Pro OFX plugin packages version 4.0 and earlier no longer worked in Vegas Pro 17 (or since). NewBlueFX's current TotalFX OFX plugin package's compatibility with Vegas Pro, according to its product webpage, is only for Vegas Pro 17 and above.

Hopefully, someone on the forum with current and pre-Vegas Pro 17 scripting experience might be able to identify specific changes applying to scripting.

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 19.0.3, 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

jetdv wrote on 2/27/2022, 7:21 AM

@william-j send me some of your code (just the offending line and enough around that line to make it valid) and I'll test it in various versions and let you know the reason why.

jetdv wrote on 2/27/2022, 7:37 AM

@william-j, I did a little testing with these three lines:

            AudioEvent aEvent = null;
            ClassicStretchAttributes aClassic = aEvent.ClassicAttribute;
            ElastiqueStretchAttributes aElastique = aEvent.ElastiqueAttribute;

ClassicStretchAttribues and ElastiqueStretchAttributes are both new features found in VEGAS Pro 16. They are not in 15 and older so you'll need to change your compatibility to 16 or newer.

william-j wrote on 3/7/2022, 6:18 AM

@william-j, I did a little testing with these three lines:

            AudioEvent aEvent = null;
            ClassicStretchAttributes aClassic = aEvent.ClassicAttribute;
            ElastiqueStretchAttributes aElastique = aEvent.ElastiqueAttribute;

ClassicStretchAttribues and ElastiqueStretchAttributes are both new features found in VEGAS Pro 16. They are not in 15 and older so you'll need to change your compatibility to 16 or newer.

Thanks, so the only way to fix the problem is to tell them that Vegas 15 and below is not supported, and I need to script these versions separately?

Dexcon wrote on 3/7/2022, 6:23 AM

so the only way to fix the problem is to tell them that Vegas 15 and below is not supported, and I need to script these versions separately?

Clearly, that is @jetdv 's advice.

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 19.0.3, 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

jetdv wrote on 3/7/2022, 8:37 AM

@william-j You would need a separate version that does not contain those options or just have one version but check the version of VEGAS that it's running on and make sure those options are not available for them to choose if on 15 or 14.

relaxvideo wrote on 3/11/2022, 12:52 AM

And

How to make my Vegas11 scripts compatible with latest versions of MAGIX Vegas?

I have script+shortcuts for example for 3d left-right/anaglyph preview window, add levels or CC filters, etc.

None of these works now with V19 :(
What should i change in the code?

Thanks for the info!

#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

set wrote on 3/11/2022, 1:22 AM

Hope this FAQ help:

https://www.vegascreativesoftware.info/us/forum/vegas-pro-scripting-faqs-resources--104563/

Setiawan Kartawidjaja
Bandung, West Java, Indonesia (UTC+7 Time Area)

Personal FB | Personal IG | Personal YT Channel
Chungs Video FB | Chungs Video IG | Chungs Video YT Channel
Personal Portfolios YouTube Playlist
Pond5 page: My Stock Footage of Bandung city

 

System 5-2021:
Processor: Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz   2.90 GHz
Video Card1: Intel UHD Graphics 630 (Driver 31.0.101.2127 (Feb 1 2024 Release date))
Video Card2: NVIDIA GeForce RTX 3060 Ti 8GB GDDR6 (Driver Version 551.23 Studio Driver (Jan 24 2024 Release Date))
RAM: 32.0 GB
OS: Windows 10 Pro Version 22H2 OS Build 19045.3693
Drive OS: SSD 240GB
Drive Working: NVMe 1TB
Drive Storage: 4TB+2TB

 

System 2-2018:
ASUS ROG Strix Hero II GL504GM Gaming Laptop
Processor: Intel(R) Core(TM) i7 8750H CPU @2.20GHz 2.21 GHz
Video Card 1: Intel(R) UHD Graphics 630 (Driver 31.0.101.2111)
Video Card 2: NVIDIA GeForce GTX 1060 6GB GDDR5 VRAM (Driver Version 537.58)
RAM: 16GB
OS: Win11 Home 64-bit Version 22H2 OS Build 22621.2428
Storage: M.2 NVMe PCIe 256GB SSD & 2.5" 5400rpm 1TB SSHD

 

* I don't work for VEGAS Creative Software Team. I'm just Voluntary Moderator in this forum.

relaxvideo wrote on 3/11/2022, 7:12 AM

Thanks!

I think it should be on the top part called "Important posts", but i see no such part.

#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

vkmast wrote on 3/11/2022, 7:19 AM

Under the "master post" (in Important posts) due to moderators needing to keep the number of pinned posts down.

jetdv wrote on 3/11/2022, 7:33 AM

And

How to make my Vegas11 scripts compatible with latest versions of MAGIX Vegas?

I have script+shortcuts for example for 3d left-right/anaglyph preview window, add levels or CC filters, etc.

None of these works now with V19 :(
What should i change in the code?

@relaxvideo

Change: "Using Sony.Vegas"

to: "Using ScriptPortal.Vegas"

Should be all you need to do.

jetdv wrote on 3/11/2022, 7:35 AM

I think it should be on the top part called "Important posts", but i see no such part.

@relaxvideo It was listed up there along with many others. But there were getting to be a LOT of posts up there so they took all of the FAQs and gathered them into that one post.

vkmast wrote on 3/11/2022, 7:49 AM

Yes, please see the screenshot above.

@relaxvideo