[Bug] Vegas.ImportFile() no longer works the way it used to in 22 b122

zzzzzz9125 wrote on 9/30/2024, 10:41 AM

Getting straight to the point, in the Scripting API of 22 build 122, Vegas.ImportFile(string fileName, bool mediaPoolOnly) no longer works as before. Instead, we can only use Vegas.ImportFile(string fileName, bool mediaPoolOnly, bool enablePromptMatchFirstVideo).

Comparison of ScriptPortal.Vegas.dll for 22 build 93 and 122:

The previous code also throws errors now in 22 build 122, which causes incompatibility with older scripts, please fix it.

Last changed by zzzzzz9125

Using VEGAS Pro 22 build 248 & VEGAS Pro 21 build 208.

Information about my PC:
Brand Name: HP VICTUS Laptop
System: Windows 11.0 (64-bit) 10.00.22631
CPU: 12th Gen Intel(R) Core(TM) i7-12700H
GPU: NVIDIA GeForce RTX 3050 Laptop GPU
GPU Driver: NVIDIA Studio Driver 560.70

Comments

zzzzzz9125 wrote on 11/14/2024, 8:11 AM

Still not fixed in 22 build 194. I wish this could be fixed, because API inconsistencies can get really annoying, and sometimes script writers have to release multiple versions of scripts to match different APIs. For VEGAS developers, however, it's just a very small change.

Last changed by zzzzzz9125 on 11/14/2024, 8:12 AM, changed a total of 1 times.

Using VEGAS Pro 22 build 248 & VEGAS Pro 21 build 208.

Information about my PC:
Brand Name: HP VICTUS Laptop
System: Windows 11.0 (64-bit) 10.00.22631
CPU: 12th Gen Intel(R) Core(TM) i7-12700H
GPU: NVIDIA GeForce RTX 3050 Laptop GPU
GPU Driver: NVIDIA Studio Driver 560.70

jetdv wrote on 11/14/2024, 9:04 AM

What if you use "OpenFile" instead?

Or just add the file manually with code (which, obviously, will take more lines of code but will work in all versions)

zzzzzz9125 wrote on 11/14/2024, 9:47 AM

What if you use "OpenFile" instead?

Or just add the file manually with code (which, obviously, will take more lines of code but will work in all versions)

@jetdv You're right, I was modifying an old script that uses ImportFile() and didn't notice that OpenFile() is still working!

Anyway, thanks for your reply, which has been adopted as a solution. It would be even better if Magix could fix ImportFile() officially.

Using VEGAS Pro 22 build 248 & VEGAS Pro 21 build 208.

Information about my PC:
Brand Name: HP VICTUS Laptop
System: Windows 11.0 (64-bit) 10.00.22631
CPU: 12th Gen Intel(R) Core(TM) i7-12700H
GPU: NVIDIA GeForce RTX 3050 Laptop GPU
GPU Driver: NVIDIA Studio Driver 560.70

zzzzzz9125 wrote on 11/17/2024, 9:29 AM

However, I still don't know what enablePromptMatchFirstVideo this parameter is for. I initially thought it was the prompt that popped up when we import the first media file into the timeline to remind us whether to match the project to the media, but importing the file with ImportFile() in the script does NOT pop up this prompt, regardless of whether the value of this parameter is true or false.

@VEGASDerek Can you explain what this parameter does? I'm a little confused about the significance of introducing this parameter in new versions.

Last changed by zzzzzz9125 on 11/17/2024, 9:36 AM, changed a total of 1 times.

Using VEGAS Pro 22 build 248 & VEGAS Pro 21 build 208.

Information about my PC:
Brand Name: HP VICTUS Laptop
System: Windows 11.0 (64-bit) 10.00.22631
CPU: 12th Gen Intel(R) Core(TM) i7-12700H
GPU: NVIDIA GeForce RTX 3050 Laptop GPU
GPU Driver: NVIDIA Studio Driver 560.70

jetdv wrote on 11/18/2024, 9:26 AM

When you have a new project and you add a new clip to the timeline, VEGAS asks if you want to match the project settings to match this new media. If you say "True" for that setting and it's the first video being added, it will ask if you want to match the project settings to that media. If you say "False", it won't ask.

zzzzzz9125 wrote on 11/18/2024, 10:31 AM

When you have a new project and you add a new clip to the timeline, VEGAS asks if you want to match the project settings to match this new media. If you say "True" for that setting and it's the first video being added, it will ask if you want to match the project settings to that media. If you say "False", it won't ask.

@jetdv Of course I know, it's the default behavior in Vegas. However, when I set this parameter to true in Vegas.ImportFile() of 22 build 122+ (using 194), it doesn't seem to work, regardless of whether there were events originally on the timeline. I suspect it's still a bug. Could you take some time to test it?

Using VEGAS Pro 22 build 248 & VEGAS Pro 21 build 208.

Information about my PC:
Brand Name: HP VICTUS Laptop
System: Windows 11.0 (64-bit) 10.00.22631
CPU: 12th Gen Intel(R) Core(TM) i7-12700H
GPU: NVIDIA GeForce RTX 3050 Laptop GPU
GPU Driver: NVIDIA Studio Driver 560.70