Add CDL adapter
** Please note ** This PR includes the same changes and replaces the closed PR here: https://github.com/AcademySoftwareFoundation/OpenTimelineIO/pull/1368 This is to avoid messy fixes solving commits missing the Sign-off after a merge with main to fix unrelated linting errors.
Link the Issue(s) this Pull Request is related to.
https://github.com/AcademySoftwareFoundation/OpenTimelineIO/issues/1366
Fixes #1366
Summarize your change.
This change adds a new adapter, 'cdl', which exports individual .cdl files to a user-provided directory for each clip/timeline event in an OTIO instance. This change does not change anything in the OTIO core.
Please note: Due to the nature of this adapter exporting multiple files instead of a single file, the provided export method name write_to_file is slightly semantically confusing. The output provided to the method should be the directory (not a file) in which you wish to export the .cdl's to. Because of this, it is also necessary to directly provide the adapter_name to use this adapter (there is no file extension to read):
otio.adapters.write_to_file(timeline, '/your/cdl/output/directory', adapter_name='cdl')
Reference associated tests.
/contrib/opentimelineio_contrib/adapters/tests/test_cdl_adapter.py provides a straightforward test which takes a sample EDL, ingests into OTIO and exports temporary .cdl files via the adapter. Two of these CDL's are read in as samples and checked.
Hi, could you try out this template for making new adapters? We are planning to move the other contrib adapters to separate repos, so instead of accepting a new one in that area & then moving it, we would prefer to have new adapters built from this template: https://github.com/OpenTimelineIO/otio-plugin-template
Also, in future, when you have merge/rebase problems, you can force-push to your branch instead of making a new PR - that way the previous discussion is not lost.
e are planning to move the other contrib adapters to separate repos, so instead of accepting a new one in that area & then moving it, we would prefer to have new adapters built from this template: https://github.com/OpenTimelineIO/otio-plugin-template
Hi @jminor, I have implemented this using that new template here: https://github.com/josh-mission/otio-cdl-adapter
Deployed to PyPi here: https://pypi.org/project/otio-cdl-adapter
Awesome! You should add your plugin to the list of tools and projects
Closed. This PR has been refactored into an external adapter repo available here: https://github.com/josh-mission/otio-cdl-adapter
Deployed to PyPi here: https://pypi.org/project/otio-cdl-adapter