ResolveScript: Timeline new Functions (Create|Update|Delete)

  • Author
  • Message
Offline

qhnu-bd

  • Posts: 12
  • Joined: Mon Jan 10, 2022 9:58 am
  • Location: Japan
  • Real Name: Masashi Sato

ResolveScript: Timeline new Functions (Create|Update|Delete)

PostMon Feb 07, 2022 11:53 pm

Version:
17.4.3

Issue:
Many functions are available, but almost none of them manipulate Timeline items.
The TimelineItem operations that can be performed now are as follows.

  • Add a clip to the end of track in the timeline.
  • The clip cannot be `edited` such as changing the timecode position or deleting it.
    MediaPool:AppendToTimeline(clip1, clip2, ...) --> [TimelineItem]


Request:
Add functions to manipulate Timelines and TimelineItems.
I have tried to keep the names as close to the current code names as possible.

  • Create
    # Adds a clip to the current timecode position.
    Timeline:InsertClipIntoTimeline(mediaPoolItem) --> TimelineItem

    # {clipInfo} is the same type as the argument of MediaPool:AppendToTimeline(). (Additional options such as video only)
    Timeline:InsertClipIntoTimeline({clipInfo}) --> TimelineItem

  • Update
    # Each of the following already has a corresponding Get function, and Set function allows you to edit a clip.
    TimelineItem:SetName(clipName) --> Bool
    Timeline:SetStartFrame(frame) --> Bool
    Timeline:SetEndFrame(frame) --> Bool

    # Behavior of selecting and dragging the bottom center of a clip in EditTab.
    # Choose to TrimEditMode with the second argument.
    TimelineItem:SetStart(frame, useTrimEditMode) --> Bool

    # Behavior of selecting and dragging the edge of a clip in EditTab.
    # Choose to TrimEditMode with the second argument.
    TimelineItem:SetLeftOffset(frame, useTrimEditMode) --> Bool
    TimelineItem:SetRightOffset(frame, useTrimEditMode) --> Bool

    # Expose and document secret track functions discovered by roger.magnusson.
    https://forum.blackmagicdesign.com/viewtopic.php?f=21&t=113040

    # This function allows you to change the vertical position of the track.
    Timeline:MoveTrackByIndex(trackType, targetTrackIndex, distTrackIndex) --> Bool

    # Change the state of the track.
    # Functions that affect the behavior of Timeline:InsertFunctions()
    Timeline:SetDestinationTrack(trackType, trackIndex, enable) --> Bool
    Timeline:GetDestinationTrack(trackType, trackIndex) --> Int
    Timeline:SetAutoTrackSelector(trackType, trackIndex, enable) --> Bool
    Timeline:GetAutoTrackSelector(trackType, trackIndex) --> Bool

  • Delete
    # Deletes a clip. This also allows for use cases such as `replace clip`.
    # Choose to RippleDelete with the first argument.
    TimelineItem:DeleteClip(useRipple) --> Bool

    # TopMenuBar > Edit > DeleteGaps functon
    Timeline:DeleteGaps() --> Bool

If there are any omissions in the specifications, I would appreciate it if you could let me know.
I know you are busy, but please check it out.
Thank you very much for your cooperation.
Offline

sushi ninja

  • Posts: 19
  • Joined: Tue Feb 14, 2023 8:01 am
  • Real Name: Satoru Taguchi

Re: ResolveScript: Timeline new Functions (Create|Update|Del

PostTue Feb 14, 2023 8:10 am

+1 and want TimelineItem:Get or SetProperty() to handle SpeedChange property
Offline

steveIA

  • Posts: 18
  • Joined: Tue Sep 22, 2020 11:52 pm
  • Location: Iowa
  • Real Name: Steve Heffern

Re: ResolveScript: Timeline new Functions (Create|Update|Del

PostTue Nov 07, 2023 9:54 pm

+1 Me TOO!

Please add AddTrack(type, name) to that list.
Steve Heffern
Hermit Computer Scientist with a filmmaking addiction

Return to DaVinci Resolve Feature Requests

Who is online

Users browsing this forum: No registered users and 31 guests