[Solved] Script: Enable "Link Clips" in ResolveScript

  • Author
  • Message
Offline

qhnu-bd

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

[Solved] Script: Enable "Link Clips" in ResolveScript

PostMon Jan 10, 2022 10:47 am

Version:
17.4.3

Issue:
Unable to use "Link Clips" in ResolveScript.

Request:
Enable the function "MenuBar > Clip > Link Clips" in scripts.
I would like to see the following code.
Code: Select all
local projectManager = resolve:GetProjectManager()
local project = projectManager:GetCurrentProject()
local timeline = project:GetCurrentTimeline()
--[[
    The above are the implemented functions
    The following are unimplemented (desired) functions
]]
--[[
    Timeline:GetCurrentVideoItem(trackIndex) --> TimelineItem
    Timeline:GetCurrentAudioItem(trackIndex) --> TimelineItem
    Timeline:Link([timelineItems]) --> Bool
    Timeline:UnLink([timelineItems]) --> Bool
]]
local linkItems = {
    timeline:GetCurrentVideoItem(1),
    timeline:GetCurrentVideoItem(2),
    timeline:GetCurrentAudioItem(1),
    timeline:GetCurrentAudioItem(2),
}
timeline:Link(linkItems)
timeline:UnLink(linkItems)
Last edited by qhnu-bd on Tue Feb 01, 2022 1:18 pm, edited 4 times in total.
Offline
User avatar

roger.magnusson

  • Posts: 3802
  • Joined: Wed Sep 23, 2015 4:58 pm

Re: [Script] Enable "Link Clips" in ResolveScript

PostWed Jan 12, 2022 12:37 am

I think the undocumented SetClipsLinked(table items, bool link) still works.
Offline

qhnu-bd

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

Re: [Script] Enable "Link Clips" in ResolveScript

PostSun Jan 16, 2022 7:54 am

Thanks for your reply.
I tried that right away, and it worked fine on version 17.4.3
Here is the code.

Code: Select all
local projectManager = resolve:GetProjectManager()
local project = projectManager:GetCurrentProject()
local timeline = project:GetCurrentTimeline()
timeline:SetClipsLinked({
    timeline:GetItemListInTrack("video", 1)[1],
    timeline:GetItemListInTrack("audio", 1)[1]
}, true)


Thank you once again!

Return to DaVinci Resolve Feature Requests

Who is online

Users browsing this forum: No registered users and 35 guests