How to modify "VIDEO FX" keyframes with vegas script?

Sunate121 wrote on 4/7/2021, 7:53 PM

Alright, after spending some time reading the Vegas API without much luck, I've decided to ask a question here:

As the title says, I want to modify a value of a specific video fx keyframe in vegas using a script.

>spam link deleted<

Here's an example: I want to modify the value of the selected keyframe to a different value.

I've checked the vegas api, but there doesn't seem to be any fields or methods that relate to modifying a video fx keyframe value.

Is it actually possible to do this using a script? If so, how can I do it?

Comments

Grazie wrote on 4/7/2021, 11:46 PM

@Sunate121 - Try posting this on the Scripting Forum: https://www.vegascreativesoftware.info/us/vegas-pro-forum/scripting/

 

jetdv wrote on 4/8/2021, 8:15 AM

First of all, you can only do this with OFX plugins. With DirectX plugins, you can only choose a preset. With OFX you can add and adjust keyframes.

Secondly, you have to make sure keyframes are "turned on". By default, they are not. The first thing you need to do is get the OFXEffect. Find the desired parameter. Turn on the keyframes. Then set the value of the keyframe at the specified time. This example is shown using a "Double" as an example. You would need to change this type as needed for the values you are changing. Hopefully this will get you moving in the right direction.
 

OFXEffect ofxEffect = effect.OFXEffect;
 //get the ofx effect
tc = new Timecode("00:00:01:00"); //set the time for the new keyframe

OFXDoubleParameter p2 = (OFXDoubleParameter)ofxEffect[Parameter];

p2.IsAnimated = true;
double oc = opacity;
p2.SetValueAtTime(tc, oc); //create the new keyframe at tc with the value oc

 

 

p.s. I don't know why the links are in the original post. They have nothing to do with this question and appear to be download products for an android phone.

vkmast wrote on 4/8/2021, 8:35 AM

@jetdv the link was not in the original post, but was added later by the OP. It is spam. I'm removing it and closing this.