lua Installer for DaVinci Resolve

Davinci Resolve introduced the DRFX format for installing FX, which is great for installing “Bundles”. Bundles are multiple effects which can even contain media, this solves the problem of media offline when importing your logo stinger. However in this article I want to suggest another option and that is using Chris Riding’s LUA installer. I have no affiliation to Chris. I just really like the way this installer works across all OS platforms and as long as the asset was created inside DaVinci Resolves folder structure it makes it ideal for any .setting file based composition.

Let me start by explaining what a .setting file based composition is. 

Whenever you or someone else builds a composition inside the fusion page and saves it out either as a macro or a raw file then it is saved as a .setting file. In Fusion standalone it is saved as a .comp file. You can’t open a .comp inside DaVinci Resolve but you can import them. Technically they are the same thing, a lua script which DaVinci Resolve has created. 

DaVinci Resolve and Fusion doesn’t change any of your original media, it creates a file which is a list of instructions telling DaVinci Resolve & Fusion what to do. You can compare this to a baking recipe. The recipe tells you how to mix the ingredients together to create your cake, you pop the mix into the oven and out comes the finished result. All those clips, assets & vfx are mixed together and then instead of going in the oven they are rendered.  A .setting or .comp contains the recipe written in a human readable format called lua. 

Why lua? 

Lua is a programming language that is lightweight and fast, it is used in gaming software and simulation software. DaVinci Resolve comes with a version of lua built in so there’s no need to add any additional pieces of software, pretty much anything coded in lua for DaVinci Resolve will just work. Even if you send it to someone else using a different operating system.

Let’s get back to Chris’s installer and compare it to drfx, before we go any further both have their merits and both have their pitfalls. DRFX is still maturing, I am looking forward to seeing what BlackMagic will do with it. 

I am not going to create a composition specifically for this article, I will however use a title I made earlier and create a lua installer from it. You can bundle different assets together and include media, so it works in a similar fashion to DRFX. The big difference from the outset is the lua installer converts everything to Base64 code which is not human readable. DRFX is basically a zipped folder with a DRFX extension and you can open it and see what’s inside, it also makes sense and is readable.

So why use Chris’s lua installer?

The biggest advantage is it can install files anywhere inside the DaVinci Resolve folder structure, whereas DRFX will only install into the “Templates” folder structure. This limits the capabilities of DRFX. Without going into too much depth, if I wanted to install a .fbx 3d model into the Comps folder or new Settings folder of a system, currently DRFX can’t do that as it doesn’t come under the “Template” structure. You also do not need to worry about the end users system. As long as you have built the comp in the correct “User” folder structure in your version of DaVinci Resolve then it will install no matter where it is. It could be the end user is using a shared resource on a server or a folder on their own computer, as DaVinci Resolve uses relative path mapping it will ignore the drive letter on PC’s and work with any operating system. Both Chris’s Installer and DRFX will place files in the “Template” folder structure on any system so they are the same there. 

Next up is versioning and updates both DRFX and the lua installer will overwrite existing files when an update comes along, although these files need to be named exactly the same the current issue with DRFX though is it will update the “Bundle” which means that if you update 1 title out of a pack of 50 you will need to include the original 49 otherwise it will delete the 49 not being updated. That is because it is updating the bundle and not the individual file. That can be a big issue if the update workflow ever has a glitch. Chris’s lua installer will only update the files selected and will not delete others.

Chris lua installer is a DaVinci Resolve script and the creator will need to install that script into their system to use it. The good news is the end user doesn’t need to do this bit, they have it easy! 

The folder structure for scripts is explained in the Davinci Resolve developer documents but I have posted a copy here for you.

Using a script

————–

DaVinci Resolve needs to be running for a script to be invoked.

For a Resolve script to be executed from an external folder, the script needs to know of the API location. 

You may need to set the these environment variables to allow for your Python installation to pick up the appropriate dependencies as shown below:

    Mac OS X:

    RESOLVE_SCRIPT_API=”/Library/Application Support/Blackmagic Design/DaVinci Resolve/Developer/Scripting”

    RESOLVE_SCRIPT_LIB=”/Applications/DaVinci Resolve/DaVinci Resolve.app/Contents/Libraries/Fusion/fusionscript.so”

    PYTHONPATH=”$PYTHONPATH:$RESOLVE_SCRIPT_API/Modules/”

    Windows:

    RESOLVE_SCRIPT_API=”%PROGRAMDATA%\Blackmagic Design\DaVinci Resolve\Support\Developer\Scripting”

    RESOLVE_SCRIPT_LIB=”C:\Program Files\Blackmagic Design\DaVinci Resolve\fusionscript.dll”

    PYTHONPATH=”%PYTHONPATH%;%RESOLVE_SCRIPT_API%\Modules\”

    Linux:

    RESOLVE_SCRIPT_API=”/opt/resolve/Developer/Scripting”

    RESOLVE_SCRIPT_LIB=”/opt/resolve/libs/Fusion/fusionscript.so”

    PYTHONPATH=”$PYTHONPATH:$RESOLVE_SCRIPT_API/Modules/”

    (Note: For standard ISO Linux installations, the path above may need to be modified to refer to /home/resolve instead of /opt/resolve)

As with Fusion scripts, Resolve scripts can also be invoked via the menu and the Console.

To use the script first head to the fusion page of DaVinci Resolve, if you have installed the script correctly you’ll find it under the Workspace menu > Scripts > Comp > InstallerCreator. The installer creator window will open. Along the left you’ll see the “PathMap” section, this shows you the current path maps on your system. They are not absolute paths as you might be running everything from your C: drive but a Mac won’t understand C: as Mac doesn’t use drive letters. 

The title I want to use is under “Edit Template” but feel free to select others and see what is there, you’ll find that you can get into the hidden depths of your installation and are able to install from Path Map to your users Path Map, ideal for non template files. 

Double clicking on an installed asset will move it to the installer file list, these are the files which will be added to your installer. You will notice “output.lua” at the bottom right, this is the name of your installer, feel free to overtype the word “output” with the name of your installer. I use the naming convention “vertigo_installer.lua” so that the end user gets a clue of what it is.

The installer file is placed in the scripts folder of DaVinci Resolve. This is because the installer creator doesn’t know where you want to put it so it keeps it inside the DaVinci Resolve folder structure. Navigate to the scripts folder and copy the file to send to the end user. I will always place this in a folder and zip the folder up, because some online cloud sharing platforms will attempt to rename the file. This is because it sees the .lua extension and thinks someone is trying to run code on their servers. 

That’s it you can now send the folder to your end user who can unzip it and drag the installer into the fusion page node graph. It will then install into the correct location, it can take anything from a few seconds to a few minutes depending on the size of the original comp and whether a png file or other media was included.

Read Article Out Loud