mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-01 16:34:53 +01:00
add clip to timeline in correct place
This commit is contained in:
parent
d83eb73e04
commit
759dc59132
2 changed files with 17 additions and 2 deletions
|
|
@ -246,7 +246,8 @@ def get_media_pool_item(fpath, root: object = None) -> object:
|
||||||
def create_timeline_item(media_pool_item: object,
|
def create_timeline_item(media_pool_item: object,
|
||||||
timeline: object = None,
|
timeline: object = None,
|
||||||
source_start: int = None,
|
source_start: int = None,
|
||||||
source_end: int = None) -> object:
|
source_end: int = None,
|
||||||
|
timeline_in: int = None) -> object:
|
||||||
"""
|
"""
|
||||||
Add media pool item to current or defined timeline.
|
Add media pool item to current or defined timeline.
|
||||||
|
|
||||||
|
|
@ -278,6 +279,12 @@ def create_timeline_item(media_pool_item: object,
|
||||||
clip_data.update({"endFrame": source_end})
|
clip_data.update({"endFrame": source_end})
|
||||||
|
|
||||||
print(clip_data)
|
print(clip_data)
|
||||||
|
|
||||||
|
if timeline_in:
|
||||||
|
timeline_start = timeline.GetStartFrame()
|
||||||
|
# Create a clipInfo dictionary with the necessary information
|
||||||
|
clip_data["recordFrame"] = int(timeline_start + timeline_in)
|
||||||
|
|
||||||
# add to timeline
|
# add to timeline
|
||||||
media_pool.AppendToTimeline([clip_data])
|
media_pool.AppendToTimeline([clip_data])
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -402,6 +402,9 @@ class ClipLoader:
|
||||||
if handle_end is None:
|
if handle_end is None:
|
||||||
handle_end = int(self.data["assetData"]["handleEnd"])
|
handle_end = int(self.data["assetData"]["handleEnd"])
|
||||||
|
|
||||||
|
self.timeline_in = int(self.data["assetData"]["clipIn"])
|
||||||
|
|
||||||
|
|
||||||
source_in = int(_clip_property("Start"))
|
source_in = int(_clip_property("Start"))
|
||||||
source_out = int(_clip_property("End"))
|
source_out = int(_clip_property("End"))
|
||||||
|
|
||||||
|
|
@ -416,7 +419,12 @@ class ClipLoader:
|
||||||
|
|
||||||
# make track item from source in bin as item
|
# make track item from source in bin as item
|
||||||
timeline_item = lib.create_timeline_item(
|
timeline_item = lib.create_timeline_item(
|
||||||
media_pool_item, self.active_timeline, source_in, source_out)
|
media_pool_item,
|
||||||
|
self.active_timeline,
|
||||||
|
source_in,
|
||||||
|
source_out,
|
||||||
|
self.timeline_in
|
||||||
|
)
|
||||||
|
|
||||||
print("Loading clips: `{}`".format(self.data["clip_name"]))
|
print("Loading clips: `{}`".format(self.data["clip_name"]))
|
||||||
return timeline_item
|
return timeline_item
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue