HEX
Server: LiteSpeed
System: Linux houston.panomity.com 6.8.0-100-generic #100-Ubuntu SMP PREEMPT_DYNAMIC Tue Jan 13 16:40:06 UTC 2026 x86_64
User: nudepix (1011)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //opt/resolve/Developer/Workflow Integrations/Examples/Sample Script Plugin.py
# Sample Workflow Integration script

import sys

# some element IDs
winID = "com.blackmagicdesign.resolve.SampleWIScript"	# should be unique for single instancing
textID = "TextEdit"
execID = "Exec"
clearID = "Clear"

ui = fusion.UIManager
dispatcher = bmd.UIDispatcher(ui)

# check for existing instance
win = ui.FindWindow(winID)
if win:
	win.Show()
	win.Raise()
	exit()
	
# otherwise, we set up a new window, with HTML header (using the Examples logo.png)
logoPath = fusion.MapPath(r"AllData:../Support/Developer/Workflow Integrations/Examples/SamplePlugin/img/logo.png")
header = '<html><body><h1 style="vertical-align:middle;">'
header = header + '<img src="' + logoPath + '"/>&nbsp;&nbsp;&nbsp;'
header = header + '<b>Resolve Sample Workflow Integration Script</b>'
header = header + '</h1></body></html>'

# define the window UI layout
win = dispatcher.AddWindow({
	'ID': winID,
	'Geometry': [ 100,100,600,500 ],
	'WindowTitle': "Resolve Sample Workflow Script",
	},
	ui.VGroup([
		ui.Label({ 'Text': header, 'Weight': 0.1, 'Font': ui.Font({ 'Family': "Times New Roman" }) }),

		ui.Label({ 'Text': "Workflow script", 'Weight': 0, 'Font': ui.Font({ 'Family': "Times New Roman", 'PixelSize': 12 }) }),
		ui.TextEdit({
			'ID': textID,
			'TabStopWidth': 28,
			'Font': ui.Font({ 'Family': "Sans Mono", 'PixelSize': 12, 'MonoSpaced': True, 'StyleStrategy': { 'ForceIntegerMetrics': True } }),
			'LineWrapMode': "NoWrap",
			'AcceptRichText': False,

			# Use python lexer for syntax highlighting; other options include lua, html, json, xml, markdown, cpp, glsl, etc...
			'Lexer': "python",
			}),

		ui.HGroup({ 'Weight': 0, }, [
			ui.Button({ 'ID': execID,  'Text': "Execute" }),
			ui.HGap(2),
			ui.Button({ 'ID': clearID, 'Text': "Clear" }),
			ui.HGap(0, 2),
			])
		])
	)

# Event handlers
def OnClose(ev):
	dispatcher.ExitLoop()

def OnExec(ev):
	script = win.Find(textID).PlainText

	# run the user's script
	exec(script)

def OnClear(ev):
	win.Find(textID).PlainText = ""

# assign event handlers
win.On[winID].Close     = OnClose
win.On[execID].Clicked  = OnExec
win.On[clearID].Clicked = OnClear


# Sample script
deftext = """
project = resolve.GetProjectManager().CreateProject("Hello World");
"""

win.Find(textID).PlainText = deftext


# Main dispatcher loop
win.Show()
dispatcher.RunLoop()