Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG Adapter erroneously assumes media_reference always has target_url #1177

Open
jlskuz opened this issue Dec 16, 2021 · 3 comments
Open

SVG Adapter erroneously assumes media_reference always has target_url #1177

jlskuz opened this issue Dec 16, 2021 · 3 comments
Labels
bug A problem, flaw, or broken functionality. good first issue If you're looking for a way to contribute, but not sure where to start. This is a good first issue.

Comments

@jlskuz
Copy link
Contributor

jlskuz commented Dec 16, 2021

Bug Report

Incorrect Functionality and General Questions

(@KarthikRIyer) The SVG Adapter erroneously assumes media_reference always has target_url. Eg. GeneratorReference does not have target_url

To Reproduce

This can be reproduced with any otio (like test.otio.zip that has a media_reference with "OTIO_SCHEMA": "GeneratorReference.1"

Run otioconvert -i test.otio -o test.svg and you will get the output in the Logs section.

OS: Linux KDE Neon (Ubunt)
Python: 3.8.10
OpenTimelineIO: 0.14.1

Expected Behavior

otioconvert -i test.otio -o test.svg should create test.svg instead of showing the error

Logs

Traceback (most recent call last):
  File "/home/julius/.local/bin/otioconvert", line 8, in <module>
    sys.exit(main())
  File "/home/julius/.local/lib/python3.8/site-packages/opentimelineio/console/otioconvert.py", line 298, in main
    otio.adapters.write_to_file(
  File "/home/julius/.local/lib/python3.8/site-packages/opentimelineio/adapters/__init__.py", line 194, in write_to_file
    return adapter.write_to_file(
  File "/home/julius/.local/lib/python3.8/site-packages/opentimelineio/adapters/adapter.py", line 212, in write_to_file
    result = self.write_to_string(input_otio, **adapter_argument_map)
  File "/home/julius/.local/lib/python3.8/site-packages/opentimelineio/adapters/adapter.py", line 303, in write_to_string
    return self._execute_function(
  File "/home/julius/.local/lib/python3.8/site-packages/opentimelineio/plugins/python_plugin.py", line 174, in _execute_function
    return (getattr(self.module(), func_name)(**kwargs))
  File "/home/julius/.local/lib/python3.8/site-packages/opentimelineio/adapters/svg.py", line 1137, in write_to_string
    return convert_otio_to_svg(input_otio, width=width, height=height)
  File "/home/julius/.local/lib/python3.8/site-packages/opentimelineio/adapters/svg.py", line 1127, in convert_otio_to_svg
    draw_item(timeline, svg_writer, ())
  File "/home/julius/.local/lib/python3.8/site-packages/opentimelineio/adapters/svg.py", line 548, in draw_item
    return WRITE_TYPE_MAP[type(otio_obj)](otio_obj, svg_writer, extra_data)
  File "/home/julius/.local/lib/python3.8/site-packages/opentimelineio/adapters/svg.py", line 590, in _draw_timeline
    item.media_reference.target_url, clip_count - 1)
AttributeError: 'opentimelineio._otio.GeneratorReference' object has no attribute 'target_url'

Additional Context

Add any other context about the problem here.

@jlskuz jlskuz added the bug A problem, flaw, or broken functionality. label Dec 16, 2021
@KarthikRIyer
Copy link
Contributor

Thanks for reporting this!
I'm currently out of station. I'll take a look at this once I'm back.

@apetrynet
Copy link
Contributor

apetrynet commented Dec 17, 2021

@KarthikRIyer, skimming through the adapter, it seems to not support ImageSequenceReference either which might cause a similar error down the road.

Instead of target_url it has an abstract_target_url() method which produces a full path if you provide a frame number abstraction like: "%04d", "#" and so on.

@KarthikRIyer
Copy link
Contributor

@apetrynet noted the need for ImageSequenceReference support in #1196

I was looking into this issue. The svg adapter doesn't seem to work well with audio tracks. That's something that needs some investigation.

It also failed for transitions at the end of the track. I've pushed a fix for that in #1195.

There are three transitions, at the same place, in the test otio file. Is that a valid scenario?
otioview too shows only the last transition.

@jminor jminor added the good first issue If you're looking for a way to contribute, but not sure where to start. This is a good first issue. label May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A problem, flaw, or broken functionality. good first issue If you're looking for a way to contribute, but not sure where to start. This is a good first issue.
Projects
No open projects
Interoperation
  
Awaiting triage
Development

No branches or pull requests

4 participants