resolve: adding input arg to create new timeline

This commit is contained in:
Jakub Jezek 2023-10-02 16:37:45 +02:00
parent baf6945b4d
commit 42f7549e05
No known key found for this signature in database
GPG key ID: 730D7C02726179A7

View file

@ -125,7 +125,7 @@ def get_any_timeline():
return project.GetTimelineByIndex(1) return project.GetTimelineByIndex(1)
def get_new_timeline(): def get_new_timeline(timeline_name: str = None):
"""Get new timeline object. """Get new timeline object.
Returns: Returns:
@ -133,7 +133,8 @@ def get_new_timeline():
""" """
project = get_current_project() project = get_current_project()
media_pool = project.GetMediaPool() media_pool = project.GetMediaPool()
new_timeline = media_pool.CreateEmptyTimeline(self.pype_timeline_name) new_timeline = media_pool.CreateEmptyTimeline(
timeline_name or self.pype_timeline_name)
project.SetCurrentTimeline(new_timeline) project.SetCurrentTimeline(new_timeline)
return new_timeline return new_timeline