Page 1 of 1

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

PostPosted: Mon Jan 10, 2022 10:47 am
by qhnu-bd
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)

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

PostPosted: Wed Jan 12, 2022 12:37 am
by roger.magnusson
I think the undocumented SetClipsLinked(table items, bool link) still works.

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

PostPosted: Sun Jan 16, 2022 7:54 am
by qhnu-bd
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!