mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 12:54:40 +01:00
Merge pull request #92 from ynput/bugfix/OP-8273_Resolve-missing-GetClipProperty
Resolve: avoiding clips without mediapoolitems
This commit is contained in:
commit
02fe605364
1 changed files with 13 additions and 7 deletions
|
|
@ -330,19 +330,25 @@ def get_timeline_item(media_pool_item: object,
|
|||
Returns:
|
||||
object: resolve.TimelineItem
|
||||
"""
|
||||
_clip_property = media_pool_item.GetClipProperty
|
||||
clip_name = _clip_property("File Name")
|
||||
clip_name = media_pool_item.GetClipProperty("File Name")
|
||||
output_timeline_item = None
|
||||
timeline = timeline or get_current_timeline()
|
||||
|
||||
with maintain_current_timeline(timeline):
|
||||
# search the timeline for the added clip
|
||||
|
||||
for _ti_data in get_current_timeline_items():
|
||||
_ti_clip = _ti_data["clip"]["item"]
|
||||
_ti_clip_property = _ti_clip.GetMediaPoolItem().GetClipProperty
|
||||
if clip_name in _ti_clip_property("File Name"):
|
||||
output_timeline_item = _ti_clip
|
||||
for ti_data in get_current_timeline_items():
|
||||
ti_clip_item = ti_data["clip"]["item"]
|
||||
ti_media_pool_item = ti_clip_item.GetMediaPoolItem()
|
||||
|
||||
# Skip items that do not have a media pool item, like for example
|
||||
# an "Adjustment Clip" or a "Fusion Composition" from the effects
|
||||
# toolbox
|
||||
if not ti_media_pool_item:
|
||||
continue
|
||||
|
||||
if clip_name in ti_media_pool_item.GetClipProperty("File Name"):
|
||||
output_timeline_item = ti_clip_item
|
||||
|
||||
return output_timeline_item
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue