Implement legacy logic where we remove the pype tag in older versions of Resolve

- Unfortunately due to API limitations cannot remove the TimelineItem from the Timeline in old versions of Resolve
This commit is contained in:
Roy Nieterau 2023-10-07 20:04:21 +02:00
parent 708aef0537
commit 26bbb702df

View file

@ -150,6 +150,15 @@ class LoadClip(plugin.TimelineItemLoader):
# function exists in Resolve
if timeline.DeleteClips is not None:
timeline.DeleteClips([timeline_item])
else:
# Resolve versions older than 18.5 can't delete clips via API
# so all we can do is just remove the pype marker to 'untag' it
if lib.get_pype_marker(timeline_item):
# Note: We must call `get_pype_marker` because
# `delete_pype_marker` uses a global variable set by
# `get_pype_marker` to delete the right marker
# TODO: Improve code to avoid the global `temp_marker_frame`
lib.delete_pype_marker(timeline_item)
# if media pool item has no remaining usages left
# remove it from the media pool