Resolve's new scripting system is able to use the same UI Manager GUI building system as Fusion 9 does. This means the existing reference material on the WSL Thread "Building GUIs With Fusion's UI Manager" can be used in Resolve 15, too.
Fusion Console View
The easiest way to run is script you download from the internet is to drag a .lua or .py script file from your desktop into the Fusion page "Nodes" view. The script will be run automatically by Resolve. Any printed messages from the script will be shown in the Fusion page "Console" view.
You can display the Console window using the Fusion > Console menu.
The Console window allows you to directly type in Lua or Python code using the input field at the bottom of the Console window. You can also paste in a block of code from your system's copy/paste clipboard buffer using the typical Command + V (macOS), or Control+V (Windows/Linux) hotkeys.
If you want to try out the Resolve 15 Fusion page scripting features for the first time you can type in the following Lua code to see details about the Fusion object, and the current composite:
Code: Select all
Code: Select all
Lua> dump(fu:GetAttrs()) table: 0x0194f793f0 FUSIONS_CLVendor = AMD FUSIONS_FileName = FUSIONH_CurrentComp = Composition (0x0x199c8c400) [App: 'Fusion' on 127.0.0.1, UUID: ccd22b89-0324-4312-b054-0baf24b87e84] FUSIONI_PhysicalRAMTotalMB = 16384 FUSIONS_CLVersion = OpenCL 1.2 1.2 (Mar 15 2018 21:59:57) FUSIONI_VersionLo = 7 FUSIONS_MachineType = IA32 FUSIONI_PhysicalRAMFreeMB = 7630 FUSIONI_VersionHi = 983040 FUSIONB_IsManager = false FUSIONS_Version = 15.0.0b.030 FUSIONS_CLType = GPU FUSIONS_CLDevice = AMD Radeon R9 M370X Compute Engine FUSIONI_SerialHi = 0 FUSIONI_VirtualRAMTotalMB = 18729 FUSIONS_GLVendor = ATI Technologies Inc. FUSIONS_GLVersion = 2.1 ATI-1.66.31 FUSIONI_VirtualRAMUsedMB = 11099 FUSIONB_IsRenderNode = false FUSIONS_GLDevice = AMD Radeon R9 M370X OpenGL Engine FUSIONI_NumProcessors = 8 FUSIONI_SerialLo = 0 Lua> dump(comp:GetAttrs()) table: 0x0194f7c5d0 COMPN_LastFrameRendered = -2000000000 COMPB_HiQ = true COMPI_RenderFlags = 131072 COMPN_ElapsedTime = 0 COMPN_AverageFrameTime = 0 COMPB_Locked = false COMPB_Modified = false COMPN_TimeRemaining = 0 COMPN_CurrentTime = 0 COMPN_RenderEnd = 0 COMPN_AudioOffset = 0 COMPH_ActiveTool = Media In (0x0x1a2d2ce00) [App: 'Fusion' on 127.0.0.1, UUID: ccd22b89-0324-4312-b054-0baf24b87e84] COMPS_Name = COMPN_GlobalStart = 0 COMPI_RenderStep = 1 COMPS_FileName = COMPB_Rendering = false COMPN_RenderStartTime = 0 COMPN_GlobalEnd = 0 COMPN_RenderEndTime = 0 COMPN_RenderStart = 0 COMPN_LastFrameTime = 0 COMPB_Proxy = false
You can run your own scripts in Resolve 15:
- From the Console window
- From the command prompt using the FuScript executable program
- From the Scripts:/Comp folder using the Fusion > Scripts menu
- From the Scripts:/Tool folder using the Nodes view right click > contextual menu
- As intool scripts on nodes which is accessed in the Inspector view > Tools > Intool Script view
- As Actions and Events that are stored inside of Config:/ PathMap based .fu files
- As code inside of graphical fuses, or Console fuses
If you open Resolve's System > Configuration section there is an External Scripting Using control that can be configured to allow remote systems to control and automate the Resolve GUI session using fuscript. You have the choice of selecting "None", "Local", or "Network" in this menu.
Resolve Command Line Scripting
Resolve 15's new scripting engine is implemented using the fuscript executable that was added by the addition of the new Fusion page. This fuscript program allow you to run a script via the command line that can control a Resolve graphical session either locally or remotely.
The fuscript executable can be found on Windows/Linux/MacOS systems. If you use fuscript frequently it can be handy to add the program to your system $PATH / %PATH% environment variable. This allows you to only have to type the words "fuscript" to launch the executable vs having to type the full absolute file path into the command line every time.
Here is a quick summary of the default location of FuScript on your Resolve 15 system:
- /Applications/DaVinci Resolve/DaVinci Resolve.app/Contents/Libraries/Fusion/fuscript
- /Program Files/Blackmagic Design/DaVinci Resolve/fuscript.exe
Code: Select all
Usage: fuscript [opts] <script> [args] -i - Enter interactive mode -v - Print version information -s - Run as script server -S - Run as script server with no timeout -p [appname] - Ping script apps -P [appname] - Ping script apps (longer timeout) -q - Be quiet -b - Run with commandline debugger -l <lang> - Explicitly set language, from: lua py2 or python2 py3 or python3 -x <string> - Execute string
Code: Select all
'/Applications/DaVinci Resolve/DaVinci Resolve.app/Contents/Libraries/Fusion/fuscript' -l lua -x 'fusion = bmd.scriptapp("Fusion", "localhost");if fusion ~= nil then fu = fusion;app = fu;composition = fu.CurrentComp;comp = composition;SetActiveComp(comp) else print("[Error] Please open up the Fusion GUI before running this tool.") end;resolve = bmd.scriptapp("Resolve", "localhost");if resolve ~= nil then res = resolve;else print("[Error] Please open up the Fusion GUI before running this tool.") end; ' /Volumes/VFX/Resolve/Scripts/ListFiles.lua'