-
Notifications
You must be signed in to change notification settings - Fork 314
Fix svg target url bug #1289
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
Fix svg target url bug #1289
Conversation
…d in formatted strings
# Conflicts: # src/py-opentimelineio/opentimelineio/adapters/svg.py
|
I think this looks reasonable. Have you got a before/after svg rendering to show what the impact of the changes is? |
| available_range = clip.source_range | ||
| if clip.media_reference.available_range: | ||
| available_range = clip.available_range() | ||
| return available_range |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would read more clearly as something like:
if clip.media_reference and clip.media_reference.available_range:
return clip.available_range()
else:
return clip.source_range
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I landed on this because pylint said the else was unnecessary. Thoughts?
Also, I noticed that the repo's setup.cfg had some settings for flake8 and not pylint but the CI/CD tests do use pylint so not sure which linter I should be using.
| return available_range | |
| if clip.media_reference and clip.media_reference.available_range: | |
| return clip.available_range() | |
| return clip.source_range |
|
The SVG adapter was aiming to create diagrams similar to the ones on this documentation page: https://opentimelineio.readthedocs.io/en/latest/tutorials/otio-timeline-structure.html Those were made by hand (and I'd love to not have to do it by hand again...) One of the tricky things that came up when we made those was trying to find a clear way to show when the source_range was or was not set. If you look closely, some of them intentionally have no source_range in an attempt to show how available_range is used instead. However that important detail is really hard to see, even if you're looking for it. For this PR, you have sort of the opposite problem. If available_range is not know, then you can guess that the source_range could be used instead - but it hides an important detail - that available_range is null. I wonder if there's a way to draw attention to the fact that either available_range or source_range is missing? Note: If both are missing, then the clip is invalid and has no way of knowing its duration. |
77b9506 to
063e7ec
Compare
063e7ec to
4fb0574
Compare
|
We should move this PR over to OpenTimelineIO/otio-svg-adapter. |
|
Thanks for the reminder @reinecke! I completely forgot about this PR. I think the actual fixes this PR introduced have been lost because of all the code style choices I made and in hindsight shouldn't have done. I will go through git history and pull over the necessary stuff to the svg adapter repo as you described and then close out this PR. |
|
Closing this PR because it was continued in the SVG adapter repo: OpenTimelineIO/otio-svg-adapter#7 and is out of date with the current state of |
Potentially starts to fix the below issues.
Fixes #629
Fixes #627
Looking for feedback on this approach with the svg adapter and then I'll move on to the other adapters