-
Vegas 12 OFX plug-in development
Hi all,
I have been developing an OFX plug-in which was working well in Vegas 11. However, in Sony Vegas Pro 12 it didn’t run. I analyzed the problem and found the following behaviour, which can be reproduced with the basic example of the OFX Support library:
My plug-in has a string parameter which is the path of a file. When the path is changed by the user, Plugin::changedParam() is supposed to check if the file exists and if so, load some information from the file and use them in the filter. (To reproduce with the basic example, just add a string parameter which has no use!)
I found out that Vegas is calling PluginFactory::createInstance() three times with three different handles and therefore creates three instances of my plugin. (I didn’t find out why Vegas is doing this! Anyone an idea???)
First when the user adds the Effect to an empty video track, Vegas creates instance_1 of the plugin, builds the UI and for each parameter calls Plugin::changedParam() once.
When Vegas is done with that, it also creates instance_2.
When the user adds a clip to the track, Vegas creates instance_3 of the plug-in.When a parameter is changed (for example the scales parameter of the basic example), Vegas calls Plugin::changedParam() once for every one of the three instances. Then it processes the frame by calling multiThreadProcessImages() in instance_2 only. It does this twice, which I assume is because I use interleaced video. This behaviour is completely fine, I just still don’t know what are instance_1 and instance_3 good for.
However, when a string parameter is changed, Vegas calls Plugin::changedParam() in instance_1 only(!) and then calls multiThreadProcessImages() in instance_2. This is the actual problem because the new information that I load from the file is available in instance_1 only and Vegas is processing the frame in instance_2, where the new infromation is not available! (The new value of the string parameter is available also in instance_2. So I could of course check myself if the parameter has changed instead of relying on Plugin::changedParam(). But somehow that’s not the point!)
Does anyone know anything about this issue? I think it’s either a bug in Vegas 12 or otherwise a behaviour I don’t understand because I don’t get what are those three instances for!
There is also something else: If I set the string parameter to param->setStringType(eStringTypeFilePath), in Vegas 11 I get a nice button which opens a dialog to choose a file. This button I also don’t get in Vegas 12!
Thanks a lot for you help!
Best regards,
Stefan