Page 1 of 1

OpenFX API bugs (?)

PostPosted: Tue Apr 13, 2021 5:00 am
by AdamSaka
Hello,
I'm new around here, and a pretty new user to Resolve. I'm porting some personal After Effects plug-ins to OpenFX (due to some of the great tools in the Studio version). I seem to have encountered a couple of bugs in the API with my "Hello World" example. Maybe it is just me doing something wrong because I'm a newbie.

I am working directly with the "C" API not the "C++ wrapper, because I wish to wrap it myself (No GPU as yet.)

Anyways here is what I have found:

1. Create Instance Action
If you don't trap the "CreateInstance" action (return kOfxStatReplyDefault), then the effect will never be rendered.

Applies to the only "Filter" context in Resolve, seems ok in Fusion's "General" context.

The OpenFX spec indicates that it is ok not to trap this action.

2. Bit Depth Support
If your plugin only indicates "8-bit" support for the output buffer, it will get called with a 32-bit float output buffer. If the render request is not checked, it could result in memory overruns as stride-length is different. (General and filter contexts)

The OpenFX spec seems to indicate that the plug-in should only be called to render with supported formats.

3. Component Format
Similar to above, but with component type support. If you indicate you only support the RGB pixel layout, you get given a buffer of type "None".

4. Generator Context
I can't get the generator context working yet. I can add it to the timeline, but the output buffer reports that the pixel layout is "None" (OfxImageComponentNone). My plug-in exits without touching the buffer. (Corrupt data is then rendered by resolve as the image, I assume the initial contents of the buffer).

Again Resolve is requesting a render with unsupported formats. There is no mesage to the user to indicate the plug-in is not supported.

Re: OpenFX API bugs (?)

PostPosted: Wed Apr 14, 2021 4:33 am
by AdamSaka
Upon further investigation....

3. Component Format

This is only a very minor issues, because the host does not indicate support for RGB. (But does not validate the plug-in's request if the host capabilities aren't checked correctly.)

4. Generator Context

It seems that only in the generator context, the clip information is not set correctly. (If you just ignore it, and assume RGBA Floats, everything works fine.)

The clip's Pixel format is reported as "None" (instead of "RGBA"), in both the clip's descriptor and instance.

The clip's bit depth is reported incorrectly in the clip descriptor as "None", but it is reported correctly in the clip's instance as "Float".