roger.magnusson wrote:But surely BMD should have defined the same package.path when executing inside Resolve and when executing using fuscript?
That's why we have this Resolve 15 Beta forum to discuss issues we care about with BMD.

If I had to guess I would say it relates to how the Fusion Standalone/Resolve global and comp specific PathMaps are dealt with from fuscript that is the issue you are experiencing.
In the command prompt, if you add the -i flag when you run fuscript it is able to be run as as standalone tool with an interactive prompt that is basically a copy of the raw Lua 5.1/LuaJIT interpreter. fuscript operates in this minimal base "LuaJIT interpreter" like mode until you tell it to connect to any host app at which time you then are given access to all of the extra features the host app is able to provide.
(This initial fuscript launching mode does not use or need your Fusion Standalone/Resolve Studio dongle to be present since you haven't connected or requested access to any functions from those host apps that would require the license.)
- Code: Select all
fuscript -i
DaVinci Resolve Script Interpreter
Copyright (C) 2005 - 2018 Blackmagic Design Pty. Ltd.
Only when you connect to bmd.scriptapp() have you defined if you want to interface with Fusion Standalone or Resolve. It is possible for fuscript to bind against a local or remote instance of Fusion Standalone or Resolve Studio so it is a bit arbitrary which system's
LuaModules: PathMap settings you would inherit until the connection is made, isn't it.
From my basic knowledge of fuscript the bmd.scriptapp() function parameters you could use are:
- Code: Select all
bmd.scriptapp('Resolve', ip, timeout, uuid, subtype)
bmd.scriptapp('FusionServer', ip, timeout, uuid, subtype)
bmd.scriptapp('Fusion', ip, timeout, uuid, subtype)
Also in the past I remember reading somewhere you could also use the bmd.scriptapp() function parameters like this:
- Code: Select all
bmd.scriptapp('Generation', ip, timeout, uuid, subtype)
bmd.scriptapp('StudioPlayer', ip, timeout, uuid, subtype)
bmd.scriptapp(GetAppName(), '127.0.0.1', timeout, GetAppUUID())
Running bmd.scriptapp() in the console returns a pointer to the host with a value like:
- Code: Select all
Lua> == bmd.scriptapp('Resolve', ip, timeout, uuid, subtype)
-- Result: Resolve (0x0x1118bcdf0) [App: 'Fusion' on 127.0.0.1, UUID: 7f4b8cf5-4bf4-4b75-a639-7816341c920d]
The Lua function
GetAppName() typically returns "Fusion" when you are inside of Resolve which allows you to run the bmd.scriptapp() with that return value and then access the pointer for the
fu:/fusion:/app: style of classes. You can print this value out in the Fusion page console window by typing in:
- Code: Select all
dump(GetAppName())
or
- Code: Select all
==GetAppName()
If you run
GetAppName() from fuscript at the command prompt you will get back something like:
- Code: Select all
Lua> ==GetAppName()
-- Result: FusionScript
The Lua function
GetAppUUID() returns a unique resource id number that is formatted like
7f4b8cf5-4bf4-4b75-a639-7816341c920d.
You can print this value out in the Console window or command line by typing in:
- Code: Select all
dump(GetAppUUID())
or
- Code: Select all
== GetAppUUID()
This returns a value like:
- Code: Select all
Lua> == GetAppUUID()
-- Result: 7f4b8cf5-4bf4-4b75-a639-7816341c920d
I haven't personally had to go all the way to needing to use the UUID value when accessing bmd.scriptapp() from a Lua script but my understanding is this value acts a bit like a PID (process ID) code so you could actually target a specific copy of Fusion/Resolve's GUI if you had several fuscript compatible programs launched and running in separate sessions on the same workstations.