Skip to content

Conversation

@avrata
Copy link
Contributor

@avrata avrata commented Dec 3, 2018

For discussion. This is a copy and modify of the existing extern_rv.py session file based rv adapter and turns it into an "in-RV" plugin that'll support reading OTIO files directly into the current session.

@codecov-io
Copy link

Codecov Report

Merging #395 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #395   +/-   ##
=======================================
  Coverage   87.05%   87.05%           
=======================================
  Files          63       63           
  Lines        5569     5569           
=======================================
  Hits         4848     4848           
  Misses        721      721

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cc762bc...6a53fdd. Read the comment docs.

@codecov-io
Copy link

codecov-io commented Dec 4, 2018

Codecov Report

Merging #395 into master will decrease coverage by 0.1%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #395      +/-   ##
==========================================
- Coverage   87.15%   87.05%   -0.11%     
==========================================
  Files          67       63       -4     
  Lines        6734     5569    -1165     
==========================================
- Hits         5869     4848    -1021     
+ Misses        865      721     -144
Impacted Files Coverage Δ
opentimelineio_contrib/adapters/fcpx_xml.py 92.19% <0%> (-1.56%) ⬇️
opentimelineio/schema/stack.py 90.32% <0%> (-1.11%) ⬇️
...elineio_contrib/adapters/tests/test_aaf_adapter.py 97.14% <0%> (-0.77%) ⬇️
...imelineio_contrib/adapters/tests/test_rvsession.py 30.88% <0%> (-0.55%) ⬇️
opentimelineio/plugins/manifest.py 90.82% <0%> (-0.33%) ⬇️
opentimelineio/core/composable.py 95.55% <0%> (-0.19%) ⬇️
opentimelineio/adapters/cmx_3600.py 91.56% <0%> (-0.06%) ⬇️
opentimelineio/algorithms/__init__.py 100% <0%> (ø) ⬆️
opentimelineio/algorithms/track_algo.py 94.8% <0%> (ø) ⬆️
opentimelineio_contrib/adapters/extern_rv.py 0% <0%> (ø) ⬆️
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 88089b1...6a53fdd. Read the comment docs.

@jminor
Copy link
Collaborator

jminor commented Dec 4, 2018

I like this strategy better than our existing RV adapter. We can certainly have both, but doing this from within RV itself has several advantages:

  • You can inspect the actual media as it loads via RV's API.
  • Easier support for both read and write. (The RV adapter doesn't support reading because the rvSession module only supports writing.)
  • Is mostly transparent to the user. They could open any OTIO-supported file format directly in RV (e.g. an EDL, FCPXML, AAF, etc.)

Ideally we could share code between this and the RV adapter, but that seems tricky since the RV in-memory API and the rvSession API are independent.
Other applications with their own app-specific file formats will likely have similar tradeoffs, so this can be a good point of reference.

Also, I like that this gets us closer to a general purpose OTIO playback tool, which would be really really handy.

Copy link
Contributor

@JoshBurnell JoshBurnell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, guys. Very cool.

"""
input_otio = otio.adapters.read_from_file(otio_file)

return create_rv_node_from_otio(input_otio)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can envision a world where we want want to initiate a Sequence with certain settings and then incorporate the OTIO into it or combine OTIO's in the same Sequence. To that end, maybe change this to something like to "write_to_file" that takes an RVSequenceGroup and writes the OTIO into it. Something like:

def write_to_rv_sequence_group(otio_obj, rv_sequence_group):
    return _create_track(otio_obj, track_kind=None, rv_sequence_group=rv_sequence_group)

def _create_track(in_seq, _=None, rv_sequence_group=None):
    new_seq = rv_sequence_group or commands.newNode("RVSequenceGroup", str(in_seq.name or "track"))
    ...

)
]

src = commands.addSourceVerbose(new_media)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there possibly a way to add the Sources outside of this adapter and, if they've already been added, have this adapter connect the existing sources into the Sequence?

I ask because, in our experience, while addSourceVerbose does add the source (verbosely), but it doesn't actively update the UI, so if you have several sources in your OTIO (as one would expect for a feature sequence), the user doesn't get any feedback until all the sources have been added. Maybe there's a world where you add all the sources for the OTIO in one step using rv.commands.addSources() (which provides a "Loading X of X" dialog) and then assemble the Sequence from the existing sources. (rv.commands.addSources() fires after-progressive-loading after it completes, so this second step could take place there.)

For an example OTIO reader, that may be overkill, but for production, it's something to consider.

Have you guys tried anything like that?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tried using QtGui.QApplication.processEvents() to solve this problem, but the nature of processEvents can reverse the order of items loaded and cause other unintended consequences. You get a nice live loading feel though. Maybe a more specific processEvents command could be a solution.

I'm not sure which events to include though. IE
app.processEvents(QtCore.QEventLoop.ExcludeUserInputEvents, stepSize)

class Mode(object):
sleeping = 1
loading = 2
processing = 3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is super clever.

@jminor jminor added needs discussion WIP Work In Progress (Not ready to merge yet) labels Dec 14, 2018
@avrata avrata closed this Sep 5, 2019
@jminor
Copy link
Collaborator

jminor commented Sep 5, 2019

Oops. This was closed by accident. We'll get it re-opened shortly...

@avrata
Copy link
Contributor Author

avrata commented Sep 6, 2019

I was unable to re-opening this unfortunately, but recreated it as #565.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

WIP Work In Progress (Not ready to merge yet)

Projects

Development

Successfully merging this pull request may close these issues.

5 participants