Page 1 of 1

Relinking Graphics

PostPosted: Thu Mar 28, 2024 10:04 pm
by Krejue
[url]https://youtu.be/yFYfCm5m4BA
[/url]

We have some graphics, who do relink wrong or don't want to link. Its seems, Resolve does not check the filename or is confused about something. Most of our lower graphics do work, but some are completely wrong. That is very bad with a 50min documentary with 40 lowers, graphics, maps, titles, subtitles and more.

Because the original name disappears when linked to the wrong media, its not possible to find the right one later- of course, there is the conform lock fonction with the <!> to choose an other clip, but in this case it shows sometimes almost every clip in the system.

With a script we would like to reconnect the graphics by their name and length. There seems to be no way to link to clips to the timeline item. Any good ideas about our workaround?

Chatbot helped me so far, but nothing happens:

function findMatchingClipInMediaPool(name, duration)
local project = resolve:GetProjectManager():GetCurrentProject()
local mediaPool = project:GetMediaPool()
local rootFolder = mediaPool:GetRootFolder()

local function scanFolder(folder)
local clips = folder:GetClips()
for _, clip in pairs(clips) do
local clipProps = clip:GetClipProperty()
if clipProps["Clip Name"] == name and tonumber(clipProps["Frames"]) == duration then
return clip
end
end

local subFolders = folder:GetSubFolders()
for _, subFolder in pairs(subFolders) do
local matchingClip = scanFolder(subFolder)
if matchingClip then
return matchingClip
end
end
end

return scanFolder(rootFolder)
end

function relinkOfflineClips()
print("Starting to relink offline clips...")
local project = resolve:GetProjectManager():GetCurrentProject()
local timeline = project:GetCurrentTimeline()
if not timeline then
print("No timeline selected.")
return
end

local videoTrackIndex = 1 -- Example: using the first video track
local trackItems = timeline:GetItemListInTrack("video", videoTrackIndex)
if trackItems then
for _, item in ipairs(trackItems) do
local mediaPoolItem = item:GetMediaPoolItem()
if mediaPoolItem then -- Check if the timeline item is linked to a media pool item
local clipProps = mediaPoolItem:GetClipProperty()
if clipProps then
local offlineStatus = clipProps["Offline"]
local name = clipProps["Clip Name"]
local duration = tonumber(clipProps["Frames"])
if offlineStatus then
print("Attempting to relink: " .. name)
local matchingClip = findMatchingClipInMediaPool(name, duration)
if matchingClip then
-- Attempt to replace the media pool item of the timeline item with the matching one
if item:ReplaceMediaPoolItem(matchingClip) then
print("Successfully relinked offline clip: " .. name)
else
print("Failed to relink clip: " .. name)
end
else
print("No matching clip found for: " .. name)
end
end
end
else
print("Item does not have an associated media pool item or is offline.")
end
end
else
print("No items found in the specified track.")
end
print("Finished attempting to relink clips.")
end

relinkOfflineClips()

Re: Relinking Graphics

PostPosted: Fri Mar 29, 2024 3:19 am
by Uli Plank
Can't help with this, but you may get more answers in the DaVinci Resolve subforum.

Re: Relinking Graphics

PostPosted: Fri Mar 29, 2024 4:30 am
by Marc Wielage
Krejue wrote:We have some graphics, who do relink wrong or don't want to link. Its seems, Resolve does not check the filename or is confused about something. Most of our lower graphics do work, but some are completely wrong. That is very bad with a 50min documentary with 40 lowers, graphics, maps, titles, subtitles and more.

We had a 10-episode documentary series a few years ago where every episode was about 45 minutes long and had dozens and dozens of graphics in each episode (TIFF, PNG, JPG, maps, text, you name it). We ran into some workflow issues and finally decided that the problem was that these file formats didn't support timecode, so the lack of unique file names and the lack of timecode was a disaster waiting to happen.

Our solution was to transcode all the graphics to ProRes 444 (we have Mac systems), which supports an Alpha channel, and made sure the graphic file clips were longer than we'd ever need (say, :30 seconds for a :10 second shot), and it worked fine. We were then able to Media Manage, and nothing ever became unlinked or disconnected for any reason.

Now, this was back in the Resolve 17 days, and perhaps things are better now with Resolve 18.5 and 18.6. But that's my immediate suggestion and I know for a fact it can work.

Re: Relinking Graphics

PostPosted: Tue Apr 09, 2024 7:23 pm
by Krejue
Thats a good point- we will check that. In our case we have unic filenames who would fit perfectly with the missing media- but resolve ingnores them. And otherways does link it to some completely other media. Lets say: map_usa.mov gets linked to opener.mov

I assume in this case it ignores the filename and just compares the cliplengths.