AcademySoftwareFoundation / OpenColorIO

A color management framework for visual effects and animation.
https://opencolorio.org
BSD 3-Clause "New" or "Revised" License
1.74k stars 430 forks source link

Add a helper function to check if an extension is supported by file transform #1962

Closed meimchu closed 3 months ago

meimchu commented 3 months ago

resolves #1938 issue. Please let me know if this is what Doug is looking for! My plan:

(Hope my auto whitespace cleanup is ok. I recognize it can make the git history slightly more dirty.)

meimchu commented 3 months ago

For the python side, I have a question about the python binding as I am not very familiar with pybind11 yet. I was testing with the following in PyFileTransform.cpp. I assumed that it is defining a python function that calls on FileTransform::IsFormatExtensionSupported and passing the extension argument.

.def("IsFormatExtensionSupported", &FileTransform::IsFormatExtensionSupported, "extension"
    DOC(FileTransform, IsFormatExtensionSupported));

However, I get a this error when trying to build about wrong argument counts. Any help and pointer about this is greatly appreciated.

error: static assertion failed due to requirement 'expected_num_args<pybind11::name, pybind11::is_method, pybind11::sibling, pybind11::arg, const char *>(sizeof...(Args), argument_loader<const char *>::args_pos >= 0, argument_loader<const char *>::has_kwargs)': The number of argument annotations does not match the number of function arguments