How to deal with PushButton OFXParameterType?

julioimolesi wrote on 8/26/2022, 7:30 AM

Hey guys

Im using Vegas Pro 18

Is therre some way to even get value from PushButton parameter type from OFXEffect class??

The enum OFXParameterType has the value PushButton, but the class simply doesnt exists.

All other types from this enum have his specific inherited classes (eg. OFXBooleanParameter, OFXChoiceParameter, OFXCustomParameter....) but not PushButton

😡😡😡😡

[edit]

Here the Exception was launched by trying to force convert of OFXParameter (type PushButton) to OFXCustomParameter type

 

thankz in advance!

 

Comments

Dexcon wrote on 8/26/2022, 7:35 AM

Is there some way to even get value from PushButton parameter type from OFX Effect??

Which OFX effect/s are you referring to and which Vegas Pro version are you using?

You've posted under the Scripting topic so please let the forum know which Script you are getting this PushButton parameter type issue with.

Cameras: Sony FDR-AX100E; GoPro Hero 8 Black

Installed: Vegas Pro 16 Edit, Vegas Pro 17 Edit, Vegas Pro 18, Vegas Pro 19 Edit, Vegas Pro 20 Edit, HitFilm Pro 2021.3, BCC 2022.5.1, Mocha Pro 2022.5.1, Ignite Pro, NBFX TotalFX 7, Sound Forge Pro 16, SpectraLayers Pro 9, iZotope RX9 Advanced

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: 1TB M.2 PCIe NVMe SSD

D drive: 6TB WD 7200 rpm Black HDD 3.5"

E & F drives: 2 x 2TB Barracuda HDDs 2.5"

 

julioimolesi wrote on 8/26/2022, 8:00 AM

Vegas Pro 18

Im trying to manipulate BCC Scatterize effect; Its not specific to this effect but any effect that have a button field

Dexcon wrote on 8/26/2022, 8:21 AM

This is probably an issue that you may need to take up with BorisFX as it relates to BCC coding - https://forum.borisfx.com/ - and any other 3rd party plugin provider that has this issue for you.

Cameras: Sony FDR-AX100E; GoPro Hero 8 Black

Installed: Vegas Pro 16 Edit, Vegas Pro 17 Edit, Vegas Pro 18, Vegas Pro 19 Edit, Vegas Pro 20 Edit, HitFilm Pro 2021.3, BCC 2022.5.1, Mocha Pro 2022.5.1, Ignite Pro, NBFX TotalFX 7, Sound Forge Pro 16, SpectraLayers Pro 9, iZotope RX9 Advanced

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: 1TB M.2 PCIe NVMe SSD

D drive: 6TB WD 7200 rpm Black HDD 3.5"

E & F drives: 2 x 2TB Barracuda HDDs 2.5"

 

jetdv wrote on 8/26/2022, 8:54 AM

@julioimolesi I'll make a tutorial on this which will be out in a couple of weeks. In short, you don't "access" a "PushButton". A button is something you "push". There are no values to change and no values to access. Instead, you change other values (if needed) and then "push" that button. So the question becomes - how do I push the button? The answer is simple:

ofxparm.ParameterChanged();

Call "ParameterChanged()" on that push button and it will - push the button. Please see the tutorial September 5th on my YouTube channel or via my website. I'll provide more details there.

julioimolesi wrote on 8/26/2022, 10:16 AM

@jetdv I dont really need to Push the button, I just need to set the filename value.
This button opens a File Selection dialog, I just need to change this value

jetdv wrote on 8/26/2022, 10:26 AM

@julioimolesi, Unless that file name is stored somewhere else you can access, you can't get that. All you can do is "push" the button from the script. You can't see a dialog that button opens. Is that file shown in some other box on that screen? Perhaps you could access that box. Either way, you have to have manual intervention to select that file.

If you CAN see that file name in another parameter, you might be able to just write the file you want to that parameter.

I don't have the BCC plugins so I don't even know what the shown options are on that screen. A screenshot might help. You might run this to see all of the available parameters.

julioimolesi wrote on 8/26/2022, 12:30 PM

@jetdv

Ive done something like the video:

its: Parameter ID: Name: Type, but i didnt found nothing that can point the right field.
Im rendering now, in couple hours I will get the description too and look for it.. thankz

ParamID.900: : Custom
ParamID.904: BCC Force Rerender Param: Double
ParamID.902: License: PushButton
ParamID.906: FX Browser: PushButton
ParamID.907: Preferences: PushButton
ParamID.1: Preset: Choice
ParamID.2: Variance: Double
ParamID.3: Scatter Percentage: Double
ParamID.4: Style: Choice
ParamID.5: Directional Angle: Double
ParamID.6: Center Point: Double2D
ParamID.7: Algorithm: Choice
ParamID.8: Randomize: Boolean
ParamID.9: Random Seed: Double
ParamID.11: Apply Mode: Choice
ParamID.12: Apply Mix: Double
ParamID.11010050: PixelChooser / Mocha: Group
ParamID.11010055: PixelChooser: Choice
ParamID.11010153: View Mask / Matte: Boolean
ParamID.11010165: Launch Mocha Mask / Track: PushButton
ParamID.11010049: PixelChooser Help: PushButton
ParamID.11010052: Presets: Choice
ParamID.11010058: Render Legacy PixelChooser: Boolean
ParamID.11010065: PixelChooser Mask: Group
ParamID.11010057: PC Mask Intensity: Double
ParamID.11010067: Shape: Choice
ParamID.11010125: : Custom
ParamID.11010092: Feather: Double
ParamID.11010081: Invert Mask: Boolean
ParamID.11010143: Lock to Effect Center: Boolean
ParamID.11010069: Center: Double2D
ParamID.11010078: Master Scale: Double
ParamID.11010073: Scale X: Double
ParamID.11010074: Scale Y: Double
ParamID.11010083: Gradient Start: Double2D
ParamID.11010085: Gradient Distance: Double
ParamID.11010086: Gradation: Double
ParamID.11010090: Stretch: Double
ParamID.11010087: Start Angle: Double
ParamID.11010088: End Angle: Double
ParamID.11010091: Rotation: Double
ParamID.11010126: Egg Balance: Double
ParamID.11010127: Rotate Around Shape Center: Boolean
ParamID.11010093: PixelChooser Matte: Group
ParamID.11010149: PC Matte Intensity: Double
ParamID.11010095: Channel: Choice
ParamID.11010096: Matte Layer: Choice
ParamID.11010097: Matte Type: Choice
ParamID.11010154: Pre Smoothing Amount: Double
ParamID.11010161: Preserve Contrast: Double
ParamID.11010098: Black Level: Double
ParamID.11010099: White Level: Double
ParamID.11010100: Threshold: Double
ParamID.11010101: Range From: Double
ParamID.11010102: Range To: Double
ParamID.11010105: Softness: Double
ParamID.11010144: Color A: RGB
ParamID.11010145: Color B: RGB
ParamID.11010146: Hue Softness: Double
ParamID.11010147: Saturation Softness: Double
ParamID.11010148: Luma Softness: Double
ParamID.11010150: Clip Black: Double
ParamID.11010151: Clip White: Double
ParamID.11010152: Gamma: Double
ParamID.11010108: Choke: Double
ParamID.11010107: Blur: Double
ParamID.11010109: Invert Matte: Boolean
ParamID.986: Legacy PixelChooser: Choice
ParamID.988: PC Intensity: Double
ParamID.955: Shape: Choice
ParamID.956: Point 1: Double2D
ParamID.957: Point 2: Double2D
ParamID.958: From: Double
ParamID.959: To: Double
ParamID.982: Scale: Double
ParamID.961: Stretch/Direction: Double
ParamID.960: Region Blend: Double
ParamID.962: Reverse Range: Boolean
ParamID.963: Channel: Choice
ParamID.964: Matte Layer: Choice
ParamID.965: Type: Choice
ParamID.966: Black/Threshold/From: Double
ParamID.967: White/To: Double
ParamID.968: Matte Softness: Double
ParamID.969: Color: RGB
ParamID.970: Blur Matte: Double
ParamID.971: Choke Matte: Double
ParamID.972: Invert Matte: Boolean
ParamID.3236: Enable Beat Reactor: Boolean
ParamID.3234: External File: PushButton
ParamID.3001: Beat Reactor: Group
ParamID.3237: Beat Reactor Help: PushButton
ParamID.10092915: Beat Reactor Preset: Choice
ParamID.3235: Watch Folder: PushButton
ParamID.10158088: Hidden: Double
ParamID.3016: Channel: Choice
ParamID.3011: Delay (sec): Double
ParamID.3172: Show Graph: Choice
ParamID.3021: Apply Parameter A: Choice
ParamID.3111: Audio Apply Options A: Group
ParamID.3086: Effect on Parameter: Choice
ParamID.3031: Output Range: Choice
ParamID.3036: Output Min: Double
ParamID.3041: Output Max: Double
ParamID.3081: Apply Strength (%): Double
ParamID.3091: Falloff: Choice
ParamID.3096: Falloff Time (sec): Double
ParamID.3126: Sampler: Choice
ParamID.3141: Sampler Corner 1: Double2D
ParamID.3156: Sampler Corner 2: Double2D
ParamID.3022: Apply Parameter B: Choice
ParamID.3112: Audio Apply Options B: Group
ParamID.3087: Effect on Parameter: Choice
ParamID.3032: Output Range: Choice
ParamID.3037: Output Min: Double
ParamID.3042: Output Max: Double
ParamID.3082: Apply Strength (%): Double
ParamID.3092: Falloff: Choice
ParamID.3097: Falloff Time (sec): Double
ParamID.3127: Sampler: Choice
ParamID.3142: Sampler Corner 1: Double2D
ParamID.3157: Sampler Corner 2: Double2D
ParamID.3023: Apply Parameter C: Choice
ParamID.3113: Audio Apply Options C: Group
ParamID.3088: Effect on Parameter: Choice
ParamID.3033: Output Range: Choice
ParamID.3038: Output Min: Double
ParamID.3043: Output Max: Double
ParamID.3083: Apply Strength (%): Double
ParamID.3093: Falloff: Choice
ParamID.3098: Falloff Time (sec): Double
ParamID.3128: Sampler: Choice
ParamID.3143: Sampler Corner 1: Double2D
ParamID.3158: Sampler Corner 2: Double2D
ParamID.3190: Audio Spectrum Options: Group
ParamID.3189: Freq Resolution: Choice
ParamID.3184: Scale (%): Double
ParamID.3181: Sub-Bass (%): Double
ParamID.3180: Bass (%): Double
ParamID.3182: Mid-Range (%): Double
ParamID.3183: Treble (%): Double
ParamID.3186: Low Cutoff dB: Double
ParamID.3187: Min Freq (Hz): Double
ParamID.3188: Max Freq (Hz): Double
ParamID.3185: Smoothness (%): Double
ParamID.3004: Audio Graph Options: Group
ParamID.3192: Graph Opacity: Double
ParamID.3173: Graph Top Left Corner: Double2D
ParamID.3176: Graph Bottom Right Corner: Double2D
 

Jason-Clement wrote on 8/29/2022, 10:09 AM

Can you explain in more detail what you're are trying to achieve through the script?

julioimolesi wrote on 9/5/2022, 9:49 AM

@Jason-Clement I want to automate the BCC Scatterize plugin settings, enabling option Beat Reactor and selecting the Audio File:

I already tried to save and load the plugin preset, but the audio file information was not saved in the preset file :/

Gid wrote on 9/5/2022, 12:16 PM

@julioimolesi Hi, It saves the external file info in the preset in VP19,

Did you rename the preset after you added the External file?

You can't modify the Default preset, you have to create a new one by renaming the Default & saving using the Save at the end of the preset name box.

Last changed by Gid on 9/6/2022, 2:51 AM, changed a total of 1 times.

Magix Movie Studio Platinum 2023 - from 2004-ish - Latest version,
Vegas Pro 20
Vegas Pro/Post 19 (Latest build), HitFilm Pro,  
Boris Continuum, Sapphire, Silhouette Standalone + Plugin, 
Mocha Pro Standalone + Plugin, Optics,
Desktop PC Microsoft Windows 10 Pro - 64-Bit
ASUS PRO WS WRX80E-SAGE SE WIFI AMD Motherboard
AMD Ryzen Threadripper PRO 3975WX 3.5GHz 32 Core
Corsair iCUE H150i RGB PRO XT 360mm All-in-One Liquid CPU Cooler
RAM 256GB ( 8x Micron 32GB (1x 32GB) 2666MHz DDR4 RAM )
2x Western Digital Black SN850 2TB M.2-2280 SSD, 7000MB/s Read, 5100MB/s Write
(programs on one, project files on the other)
Graphics MSI GeForce RTX 3090 SUPRIM X 24GB OC GPU
ASUS ROG Thor 1200W Semi-Modular 80+ Platinum PSU 
Fractal Design Define 7 XL Dark TG Case with 3 Fans

I'm 53, I've been a UK joiner for 37yrs, apprentice trained & time served, I make videos about my work & post them on Youtube so that i can share what I've learnt over the yrs,
https://www.youtube.com/c/Gidjoiner

At the moment my filming is done with a Samsung Galaxy S21 Ultra 5G

julioimolesi wrote on 9/5/2022, 1:29 PM

@Gid Do you know where preset files are saved?

Maybe its possible to modify it and load by the script..

Gid wrote on 9/6/2022, 2:50 AM

@julioimolesi No sorry i don't know how to load a preset by a script, @jetdv is better to answer that,

 Why do you want to load the preset via a script?

Magix Movie Studio Platinum 2023 - from 2004-ish - Latest version,
Vegas Pro 20
Vegas Pro/Post 19 (Latest build), HitFilm Pro,  
Boris Continuum, Sapphire, Silhouette Standalone + Plugin, 
Mocha Pro Standalone + Plugin, Optics,
Desktop PC Microsoft Windows 10 Pro - 64-Bit
ASUS PRO WS WRX80E-SAGE SE WIFI AMD Motherboard
AMD Ryzen Threadripper PRO 3975WX 3.5GHz 32 Core
Corsair iCUE H150i RGB PRO XT 360mm All-in-One Liquid CPU Cooler
RAM 256GB ( 8x Micron 32GB (1x 32GB) 2666MHz DDR4 RAM )
2x Western Digital Black SN850 2TB M.2-2280 SSD, 7000MB/s Read, 5100MB/s Write
(programs on one, project files on the other)
Graphics MSI GeForce RTX 3090 SUPRIM X 24GB OC GPU
ASUS ROG Thor 1200W Semi-Modular 80+ Platinum PSU 
Fractal Design Define 7 XL Dark TG Case with 3 Fans

I'm 53, I've been a UK joiner for 37yrs, apprentice trained & time served, I make videos about my work & post them on Youtube so that i can share what I've learnt over the yrs,
https://www.youtube.com/c/Gidjoiner

At the moment my filming is done with a Samsung Galaxy S21 Ultra 5G

Jason-Clement wrote on 9/6/2022, 7:14 AM

@julioimolesi One thing to remember is there are two different types of presets. There are Continuum's own presets which are stored in C:\ProgramData\BorisFX\Continuum. And there are the Vegas host presets which are stored in Documents/OFX Presets.

It appears that the Vegas Host presets to retain the audio file information, but the audio info is stored in an encoded binary format as part of the ParamID.900 custom param, not as a simple text string so there is no easy to edit its contents. And the Continuum presets do not appear to store the beat reactor settings at this time - which kind of surprises me. I wonder if that is a bug - something we'll need to look into. Unfortunately I don't see a way to readily edit the audio file via preset manipulation.

-Jason

jetdv wrote on 9/6/2022, 7:18 AM

@julioimolesi, @Gid Here's how to do that:

PlugInNode effects = myVegas.VideoFX;
PlugInNode thisEff = effects.GetChildByUniqueID("{Unique ID of the effect you want to load}");
Effect eventEffect = new Effect(thisEff);
vEvent.Effects.Add(eventEffect);
eventEffect.Preset = "Name of the preset to load";

Line 1 - get the list of all effects from VEGAS

Line 2 - find the specific effect you want to use

Line 3 - Get that effect as a new effect to be added to the event

Line 4 - Add it to the video event

Line 5 - Set the preset you want to use

jetdv wrote on 9/6/2022, 7:29 AM

And here's the tutorial showing how to "push" the button from a script.

 

Gid wrote on 9/6/2022, 9:28 AM

@Jason-Clement @julioimolesi 👍 I see now, i think,

Vegas saves the preset no problem with the external file info, the Sampler corner points positions & all the other settings/parameters.

But the Boris fx preset save/load option only saves the parameters, not the external file info, & in the preset box it still shows 'No Preset' even tho one has been saved & loaded.

@jetdv Thanks, I've never got involved with scripts... maybe one day 👍

Magix Movie Studio Platinum 2023 - from 2004-ish - Latest version,
Vegas Pro 20
Vegas Pro/Post 19 (Latest build), HitFilm Pro,  
Boris Continuum, Sapphire, Silhouette Standalone + Plugin, 
Mocha Pro Standalone + Plugin, Optics,
Desktop PC Microsoft Windows 10 Pro - 64-Bit
ASUS PRO WS WRX80E-SAGE SE WIFI AMD Motherboard
AMD Ryzen Threadripper PRO 3975WX 3.5GHz 32 Core
Corsair iCUE H150i RGB PRO XT 360mm All-in-One Liquid CPU Cooler
RAM 256GB ( 8x Micron 32GB (1x 32GB) 2666MHz DDR4 RAM )
2x Western Digital Black SN850 2TB M.2-2280 SSD, 7000MB/s Read, 5100MB/s Write
(programs on one, project files on the other)
Graphics MSI GeForce RTX 3090 SUPRIM X 24GB OC GPU
ASUS ROG Thor 1200W Semi-Modular 80+ Platinum PSU 
Fractal Design Define 7 XL Dark TG Case with 3 Fans

I'm 53, I've been a UK joiner for 37yrs, apprentice trained & time served, I make videos about my work & post them on Youtube so that i can share what I've learnt over the yrs,
https://www.youtube.com/c/Gidjoiner

At the moment my filming is done with a Samsung Galaxy S21 Ultra 5G

julioimolesi wrote on 9/7/2022, 10:49 AM

@Jason-Clement

I found the file, but its encrypted, i will try some tricks later if I cant bypass using @jetdv tutorial

Jason-Clement wrote on 9/7/2022, 12:30 PM

@julioimolesi It's not actually encrypted, but it's a binary data format - not human readable strings - so not really editable through scripting unfortunately.