Page 1 of 1

OFX Plugin Examples

PostPosted: Wed Aug 14, 2019 4:42 am
by Gary Hango
I'm delving into creating OFX plugins and was able to compile and use the example plugin source code that installs with Resolve. I need an example of how to use the Choice Parameter so I can have a list of choices presented on the effects settings. The included examples show floating point and integer sliders, and a Boolean check box, but not a list box. Any help here?

Thanks.

Re: OFX Plugin Examples

PostPosted: Wed Aug 14, 2019 6:49 am
by Kel Philm
Maybe post the question over here:

viewforum.php?f=12

Re: OFX Plugin Examples

PostPosted: Wed Aug 14, 2019 9:56 am
by Hendrik Proosa
Look into OFX documentation, specifically chapter 9. Effect parameters:
http://openfx.sourceforge.net/Documenta ... index.html

Re: OFX Plugin Examples

PostPosted: Wed Aug 14, 2019 1:52 pm
by Gary Hango
Hendrik Proosa wrote:Look into OFX documentation, specifically chapter 9. Effect parameters:
http://openfx.sourceforge.net/Documenta ... index.html

Yes, I did read these, and I will study them more, but it’d really be nice to see how it’s actually used by example.

Re: OFX Plugin Examples

PostPosted: Wed Aug 14, 2019 2:05 pm
by Gary Hango
Kel Philm wrote:Maybe post the question over here:

viewforum.php?f=12

Done. Thank you.

Re: OFX Plugin Examples

PostPosted: Wed Aug 14, 2019 2:12 pm
by Martin Schitter
Gary Hango wrote:
Hendrik Proosa wrote:...but it’d really be nice to see how it’s actually used by example.


https://github.com/baldavenger/BaldavengerOFX
https://github.com/NatronGitHub/openfx-misc

Re: OFX Plugin Examples

PostPosted: Wed Aug 14, 2019 2:33 pm
by Gary Hango
Martin Schitter wrote:
Gary Hango wrote:
Hendrik Proosa wrote:...but it’d really be nice to see how it’s actually used by example.


https://github.com/baldavenger/BaldavengerOFX
https://github.com/NatronGitHub/openfx-misc

Martin, I have looked at these, but they seem to not be following the same syntax as the Resolve examples. They also don’t give examples to use CUDA and OpenCL.

Re: OFX Plugin Examples

PostPosted: Wed Aug 14, 2019 3:26 pm
by Martin Schitter
Gary Hango wrote:Martin, I have looked at these, but they seem to not be following the same syntax as the Resolve examples. They also don’t give examples to use CUDA and OpenCL.


yes resolve provides a few proprietary non-standard conform extensions and doesn't support some of the more common openfx API suites. compatible support of GPU acceleration is still a very problematic demand in this regard.

Re: OFX Plugin Examples

PostPosted: Wed Aug 14, 2019 3:27 pm
by Rohit Gupta
Martin Schitter wrote:
Gary Hango wrote:Martin, I have looked at these, but they seem to not be following the same syntax as the Resolve examples. They also don’t give examples to use CUDA and OpenCL.


yes resolve provides a few proprietary non-standard conform extensions and doesn't support some of the more common openfx API suites. compatible support of GPU acceleration is still a very problematic demand in this regard.


What suite are you missing Martin?

Re: OFX Plugin Examples

PostPosted: Wed Aug 14, 2019 3:36 pm
by Martin Schitter
Rohit Gupta wrote:What suite are you missing Martin?


better support for generator contexts, because this would open the possibility to implement and use third party file readers (e.g. https://github.com/MrKepzie/openfx-io )

Re: OFX Plugin Examples

PostPosted: Wed Aug 14, 2019 4:27 pm
by Gary Hango
Rohit, any chance we could get a few more plugin examples that show how to use more parameter types?

Re: OFX Plugin Examples

PostPosted: Wed Aug 14, 2019 4:49 pm
by Paul Dore
Gary Hango wrote:
https://github.com/baldavenger/BaldavengerOFX
https://github.com/NatronGitHub/openfx-misc
Martin, I have looked at these, but they seem to not be following the same syntax as the Resolve examples. They also don’t give examples to use CUDA and OpenCL.


Look again. Baldavenger OFX Plugins are written specifically for Resolve, and nearly all include a CUDA kernel (some also use OpenCL). Many feature the Choice Parameter extensively e.g. ACES OFX, HueConverge, Convolution, etc.

Re: OFX Plugin Examples

PostPosted: Wed Aug 14, 2019 5:20 pm
by Jean Claude
@Gary,

Look in 1st time the source 'Gainplugin' which is in the directory 'Developer' delivered with Davinci Resolve.

You have to understand the functional in 'GainPlugin.cpp'. How are the directions structured between CUDA, OPENCL and METAL.

Then: see cuda file (CudaKernel.cu), OPENCL (OpenCLKernel.cpp) and METAL (MetalKernel.mm)

As Paul said (Hi Paul), you will find in his collection of OFX source all sorts of settings and how to implement them.

Download the sources (https://github.com/baldavenger/BaldavengerOFX)

Download the OFX (https://github.com/baldavenger/BaldavengerPlugins). You install them and you inspect them. When a parameter offers one of those you are looking for ... opens the source project via Visual Studio. You will find the source code.

Start with GainPlugin and check with you that it works. No need to go further as this OFX will not work:
Make sure you have the right CUDA.SDK libraries, etc ...
(just a feedback)

Heu for METAL: if you're not with MAC. You forget.

Hope this helps you. I can not anymore.. :)

Re: OFX Plugin Examples

PostPosted: Wed Aug 14, 2019 7:51 pm
by Gary Hango
Paul Dore wrote:
Gary Hango wrote:
https://github.com/baldavenger/BaldavengerOFX
https://github.com/NatronGitHub/openfx-misc
Martin, I have looked at these, but they seem to not be following the same syntax as the Resolve examples. They also don’t give examples to use CUDA and OpenCL.


Look again. Baldavenger OFX Plugins are written specifically for Resolve, and nearly all include a CUDA kernel (some also use OpenCL). Many feature the Choice Parameter extensively e.g. ACES OFX, HueConverge, Convolution, etc.

Paul, you’re right. I actually missed your collection of plugin source code. I perused the Natron code and the OpenFX 1.4 examples. I’m looking at your code now and have to say it’s a treasure trove of examples. Thanks for sharing them.

Re: OFX Plugin Examples

PostPosted: Wed Aug 14, 2019 10:53 pm
by Gary Hango
Paul, I notice that your code uses some include files not in the OpenFX 1.4 include directory. They start with ofxs__.h. The ones in the 1.4 directory are ofx__.h. These seem to be "Hack" files from the TuttleOFX sources. How do I include these in the Resolve installed examples. Namely, "ChoiceParamDescriptor"?

Thanks.

Re: OFX Plugin Examples

PostPosted: Thu Aug 15, 2019 10:10 pm
by Gary Hango
Gary Hango wrote:Paul, I notice that your code uses some include files not in the OpenFX 1.4 include directory. They start with ofxs__.h. The ones in the 1.4 directory are ofx__.h. These seem to be "Hack" files from the TuttleOFX sources. How do I include these in the Resolve installed examples. Namely, "ChoiceParamDescriptor"?

Thanks.

Never mind. I figured it out. The Resolve examples are already using the ofxs__.h headers. For the ChoiceParamDescriptor function I had to add OFX:: in front of it like all the others in the Resolve examples.

I got my plugin to add the list of choices. Now I just have to add the logic in the code to switch to the different methods.

Thanks again.