
- Posts: 174
- Joined: Thu Aug 04, 2022 5:07 pm
- Real Name: Dorin Godja
IMPORTANT!
Scripts with UI require Studio license since 19.1.
This script will work in the Free version of DaVinci Resolve only if DR is prior to 19.1
Use Cases Scenarios:
1) Playhead Lock when needed
Then:
2) When Locked, It acts like "Playhead Return" or "Stop and Go to Last Position" even in the Color Page:
a) Pressing space once will start playing; pressing space again will stop playing and return to the locked position.
or
b) JKL keys (Shuttle Controls) play as usual, but when stopped (K), the playhead will return to the locked position.
This is a Lua script for DaVinci Resolve (tested on DR 19.0.2 - the free one).
It creates a small on-top tool, movable, with a button to lock/unlock the playhead
- it is beta, might not work as expected but seems quite light and reliable on my early tests.
A short video about it is here:

cheers,
Dorin
Scripts with UI require Studio license since 19.1.
This script will work in the Free version of DaVinci Resolve only if DR is prior to 19.1
Use Cases Scenarios:
1) Playhead Lock when needed
Then:
2) When Locked, It acts like "Playhead Return" or "Stop and Go to Last Position" even in the Color Page:
a) Pressing space once will start playing; pressing space again will stop playing and return to the locked position.
or
b) JKL keys (Shuttle Controls) play as usual, but when stopped (K), the playhead will return to the locked position.
This is a Lua script for DaVinci Resolve (tested on DR 19.0.2 - the free one).
It creates a small on-top tool, movable, with a button to lock/unlock the playhead
- it is beta, might not work as expected but seems quite light and reliable on my early tests.
A short video about it is here:

- Code: Select all
-- Playhead Lock ON-OFF Lua Resolve Script by DorinDXN
-- version 0.6 -- beta
-- license CC0
--
--[[
Save this file as:
Windows
C:\ProgramData\Blackmagic Design\DaVinci Resolve\Fusion\Scripts\Utility\DXN Playhead Lock ON-OFF.lua
Mac
/Library/Application Support/Blackmagic Design/DaVinci Resolve/Fusion/Scripts/Utility/DXN Playhead Lock ON-OFF.lua
then you can launch it using the menu:
Workspace \ Scripts \ DXN Playhead Lock ON-OFF
--]]
local ui = fu.UIManager
local disp = bmd.UIDispatcher(ui)
local resolve = app:GetResolve()
local projectManager = resolve:GetProjectManager()
local project = projectManager:GetCurrentProject()
local timeline = project:GetCurrentTimeline()
if not timeline then
print("No timeline is open.")
return
end
local isPlayheadLocked = false
local lockedTimecode = timeline:GetCurrentTimecode()
local function lockPlayhead()
if isPlayheadLocked then
local currentPlayheadTimecode = timeline:GetCurrentTimecode()
if currentPlayheadTimecode ~= lockedTimecode then
timeline:SetCurrentTimecode(lockedTimecode)
end
end
end
local win = disp:AddWindow({
ID = "Playhead",
WindowTitle = "DXN Playhead Lock",
Geometry = { 100, 100, 150, 50 },
WindowFlags = {
Tool = true,
MSWindowsFixedSizeDialogHint = true
},
ui:VGroup {
ID = "playground",
ui:HGroup {
Weight = 0,
ui:Button { ID = "btnLock", Text = "PLAYHEAD FREE" },
},
},
})
local itm = win:GetItems()
function win.On.btnLock.Clicked(ev)
if itm.btnLock.Text == "PLAYHEAD FREE" then
itm.btnLock.Text = "PLAYHEAD LOCKED"
lockedTimecode = timeline:GetCurrentTimecode()
isPlayheadLocked = true
else
itm.btnLock.Text = "PLAYHEAD FREE"
isPlayheadLocked = false
end
end
local timer_func = {}
local timerPH = ui:Timer {
ID = "TimerPH",
Interval = 200,
SingleShot = false
}
timer_func[timerPH.ID] = function()
lockPlayhead()
end
function disp.On.Timeout(ev)
timer_func[ev.who]()
end
function win.On.Playhead.Close(ev)
disp:ExitLoop()
timerPH:Stop()
end
win:Show()
timerPH:Start()
disp:RunLoop()
win:Hide()
cheers,
Dorin
Last edited by DorinDXN on Tue Feb 18, 2025 10:12 am, edited 1 time in total.
DaVinci Resolve Anthem
https://www.youtube.com/watch?v=CcKC8R9ku50
DaVinci Resolve Clips
https://www.youtube.com/playlist?list=PLYgg-7sUX2Jh3dqNJ0AVBTIlDFtufrYyn
Playhead Lock Script
https://forum.blackmagicdesign.com/viewtopic.php?f=21&t=210163
https://www.youtube.com/watch?v=CcKC8R9ku50
DaVinci Resolve Clips
https://www.youtube.com/playlist?list=PLYgg-7sUX2Jh3dqNJ0AVBTIlDFtufrYyn
Playhead Lock Script
https://forum.blackmagicdesign.com/viewtopic.php?f=21&t=210163