I'm trying to study how to make OFX plugin

Hi, I’m a visual effect artist and a programmer.
Usually I’m using After Effects, but now I’m interested in node based compositor like Natron or Fusion. And for a long time, I want to create a plugin. So I think OFX is a good start. But the problem is the documentation of OFX is minimal.

So in this thread, maybe I’ll post my progress in my study, it’s more like a blog. Some insight what I get, my doubt, my question, etc.

So if you are interested in this topic, please chime in :D.
Or if you have knowledge about this stuff, please enlighten me :D.
Thanks.

3 Likes

Firstly maybe I’ll post about the resource to learn this.
The first place that I really like, is here:
https://openfx.readthedocs.io/en/master/Guide/ofxExamples.html#the-examples

You will get the glimpse how OFX works, how can the Plugin talks to the Host.
Host is the software that uses the plugin (like Natron, Fusion, Nuke, etc).

Basically, there’s an asymmetric how to communicate between the Host and Plugin.
From Plugin to Host, the Plugin can execute some function that Host provides.
But from Host to Plugin, the Host will only execute one general function (the entry point), with the argument, what action that it needs to perform and what arguments, and what output expected.

Some important thing is the Host will ask the Plugin to describe itself, like what his name, what bitdepth it supports, what parameter that it needs, what kind of parameter, etc.

And then there’s a most important action, it’s the render action. Basically the Host will give a rectangle which needs to be filled. And Plugin will try to fill it.

The example in that link is low-level programming, so there’s some task that seems tedious to do. And in the production code, like this:


They don’t use low-level code. They wrap some function, so it’s more easy to use.

They use this library to wrap some code:

And also, there’s some other function that will make life easier to perform common task, like sampling, masking, etc. It’s in this library:

1 Like