Jump to: Board index » General » Fusion

Fusion Lua Modules

Learn about 3D compositing, animation, broadcast design and VFX workflows.
  • Author
  • Message


  • Posts: 6
  • Joined: Fri Jul 27, 2018 9:45 pm
  • Real Name: Cédric Duriau

Fusion Lua Modules

PostWed Aug 08, 2018 8:18 pm


With Cryptomatte having an external module, I've been struggling with deploying modules correctly for almost two years now. I would like to settle this issue and have a simple and correct workflow to document so that all Fusion Cryptomatte users can install the fuse without any issues.

Let's start with Fusion 9.0.2 build 15 on Windows 10 x64.
The fusion directory of the Cryptomatte repo has been made so to replicate the Fusion root.
So deploying would be done as following:

COPY %CRYPTOMATTE_ROOT%\fusion\Fuses\Matte\* TO C:\Program Files\Blackmagic Design\Fusion 9\Fuses\Matte
COPY %CRYPTOMATTE_ROOT%\fusion\Modules\Lua\* TO C:\Program Files\Blackmagic Design\Fusion 9\Modules\Lua

When you do this, you would assume that everythong works, considering Fusion loads it's LuaModules by checking for a UserPaths:Modules/Lua location. But instead of working as expected, when launching Fusion, you get the following error:

Startup error.
lua_error.png (23.65 KiB) Viewed 949 times

Now because I know out of experience that previously released Fusion versions read a certain "lua" directory to load it's modules out of the install root, I also copied the cryptomatte utility module into that directory. Meaning I would have the following Fusion tree structure

C:\Program Files\Blackmagic Design\Fusion 9\Modules\Lua\cryptomatte_utilities.lua
C:\Program Files\Blackmagic Design\Fusion 9\lua\cryptomatte_utilities.lua

The fuse finally finds it's utility module to load.
Now strangely enough, the module inside the "lua" directory only gets checked at startup.
Only changes to the .lua file inside the "Modules\Lua" directories are accepted within Fusion, using the edit button on the fuse.

Only having the module inside the root "lua" directory does not cause the startup error, but the fuse cannot load the module from that location. It does require it to be in the "Modules/Lua" directory. Othwerwise this error happens in the console when using the fuse:

Code: Select all
...\Blackmagic Design\Fusion 9\Fuses\Matte\cryptomatte.fuse:13: module 'cryptomatte_utilities' not found:
   no field package.preload['cryptomatte_utilities']
   no file 'C:\Users\cedric\AppData\Roaming\Blackmagic Design\Fusion\Modules\Lua\cryptomatte_utilities.lua'
   no file 'C:\ProgramData\Blackmagic Design\Fusion\Modules\Lua\cryptomatte_utilities.lua'
   no file 'C:\Program Files\Blackmagic Design\Fusion 9\Modules\Lua\cryptomatte_utilities.lua'
   no file 'C:\Users\cedric\AppData\Roaming\Blackmagic Design\Fusion\Modules\Lua\cryptomatte_utilities\init.lua'
   no file 'C:\ProgramData\Blackmagic Design\Fusion\Modules\Lua\cryptomatte_utilities\init.lua'
   no file 'C:\Program Files\Blackmagic Design\Fusion 9\Modules\Lua\cryptomatte_utilities\init.lua'
   no file 'C:\Users\cedric\AppData\Roaming\Blackmagic Design\Fusion\Modules\Lua\cryptomatte_utilities.dll'
   no file 'C:\ProgramData\Blackmagic Design\Fusion\Modules\Lua\cryptomatte_utilities.dll'
   no file 'C:\Program Files\Blackmagic Design\Fusion 9\Modules\Lua\cryptomatte_utilities.dll'
attempt to call a nil value

Could this be looked into?
Am I doing anything out of order?
Am I right to assume that this is absolutely no default behavior and that the "Modules/Lua" should just work?

Eager to hear back from you.


PS: Any comment about not using an external module as a fix is out of the question.

Jeff Ha

  • Posts: 121
  • Joined: Tue Apr 14, 2015 10:38 am

Re: Fusion Lua Modules

PostWed Aug 15, 2018 11:29 am

always struggled with that on the Mac side too. I've placed it in various locations but it never took until I was forced to throw the lua into usr/share/lua or something (can't recall). We can't use reactor on our closed network so troubleshooting Crypomatte wasn't fun. The path maps in Fusion don't really seem to work in this case, maybe the way Cryptomatte is coded.

Return to Fusion

Who is online

Users browsing this forum: No registered users and 8 guests