mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
feat: Copy ACES input transform from timeline clip to new media item
This commit adds functionality to copy the ACES input transform from a timeline clip to a new media item. It retrieves the IDT (Input Device Transform) property from the timeline clip and sets it on the new media item. Also, it updates the ClipLoader class in plugin.py to read trimming information from the timeline item instead of using "Start" and "End" properties. The start time is calculated as the left offset of the timeline item, and the end time is calculated by adding the duration of the timeline item to its start time. These changes improve compatibility and ensure accurate copying of clips in Ayon Core Resolve API.
This commit is contained in:
parent
21a10c53d7
commit
b3a39ddcc3
2 changed files with 11 additions and 4 deletions
|
|
@ -713,6 +713,11 @@ def swap_clips(from_clip, to_clip, to_in_frame, to_out_frame):
|
|||
bool: True if successfully replaced
|
||||
|
||||
"""
|
||||
# copy ACES input transform from timeline clip to new media item
|
||||
mediapool_item_from_timeline = from_clip.GetMediaPoolItem()
|
||||
_idt = mediapool_item_from_timeline.GetClipProperty('IDT')
|
||||
to_clip.SetClipProperty('IDT', _idt)
|
||||
|
||||
_clip_prop = to_clip.GetClipProperty
|
||||
to_clip_name = _clip_prop("File Name")
|
||||
# add clip item as take to timeline
|
||||
|
|
|
|||
|
|
@ -477,14 +477,16 @@ class ClipLoader:
|
|||
)
|
||||
_clip_property = media_pool_item.GetClipProperty
|
||||
|
||||
source_in = int(_clip_property("Start"))
|
||||
source_out = int(_clip_property("End"))
|
||||
# Read trimming from timeline item
|
||||
timeline_item_in = timeline_item.GetLeftOffset()
|
||||
timeline_item_len = timeline_item.GetDuration()
|
||||
timeline_item_out = timeline_item_in + timeline_item_len
|
||||
|
||||
lib.swap_clips(
|
||||
timeline_item,
|
||||
media_pool_item,
|
||||
source_in,
|
||||
source_out
|
||||
timeline_item_in,
|
||||
timeline_item_out
|
||||
)
|
||||
|
||||
print("Loading clips: `{}`".format(self.data["clip_name"]))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue