In light of the Coronavirus crisis, please help make sure nothing stands in the way of social distancing in the VFX industry.

This petition asks the MPAA to act accordingly:


Sign the petition on Change.org

Be safe, everyone.

How to start Reactor once installed?

Moderator: SecondMan

User avatar
maarten
Posts: 27
Joined: Sun Dec 15, 2019 9:17 am

How to start Reactor once installed?

#1

Post by maarten » Sun Feb 23, 2020 6:39 am

Hi, this is probably a silly question to you guys, but some months ago I installed Reactor with some plugin and now I want to install the same plugin on another machine and therefor like to open Reactor on the first machine. But after searching a lot everywhere both in the software (DaVinci REsolve 16 - fusion tab) as well as online I can't find any instructions on how to actually open Reactor once installed.

So how can I open Reactor from within the software?

Thanks a lot in advance!

[edit] I see now that dropping the reactor.lua script on the fusion tab starts the program. Do we really need to do it this way, or is there also some menu or button or something else in the UI that is able to start Reactor from DaVinci Resolve Fusion itself?

User avatar
SecondMan
Site Admin
Posts: 4243
Joined: Thu Jul 31, 2014 5:31 pm
Answers: 15
Location: Vancouver, Canada
Been thanked: 62 times
Contact:

Re: How to start Reactor once installed?

#2

Post by SecondMan » Sun Feb 23, 2020 9:18 am

Not such a silly question at all. Unfortunately Resolve doesn't allow for additional top level menus like in Fusion Standalone, so the Reactor menu is hiding in the following location:

Image

User avatar
maarten
Posts: 27
Joined: Sun Dec 15, 2019 9:17 am

Re: How to start Reactor once installed?

#3

Post by maarten » Sun Feb 23, 2020 1:32 pm

Ah, I see. Thanks a lot! It would indeed be nice to have a top level menuitem, but this is fine too. Better than needing to drag'n'drop the .lua file everytime :)

User avatar
Shem Namo
Fusionista
Posts: 369
Joined: Sun Oct 06, 2019 9:15 pm
Location: North Israel
Real name: David Kohen
Been thanked: 6 times

Re: How to start Reactor once installed?

#4

Post by Shem Namo » Sun Feb 23, 2020 2:01 pm

You can also try putting this in your macro folder, I made it so I don't have to go through the menu all the time.

Thanks,
David.
Code: [Select all] [Expand/Collapse] [Download] (Launch Reactor.setting)
  1. {
  2.     Tools = ordered() {
  3.         LaunchReactor = MacroOperator {
  4.             Inputs = ordered() {
  5.                 Input1 = InstanceInput {
  6.                     SourceOp = "Transform1",
  7.                     Source = "LaunchReactor",
  8.                     Page = "Controls",
  9.                 },
  10.             },
  11.             ViewInfo = GroupInfo {
  12.                 Name = "Launch Reactor",
  13.                 Pos = { 0, 0 }
  14.             },
  15.             Tools = ordered() {
  16.                 Transform1 = Transform {
  17.                     CtrlWZoom = false,
  18.                     ViewInfo = OperatorInfo { Pos = { 605, 280.5 } },
  19.                     UserControls = ordered() {
  20.                         LaunchReactor = {
  21.                             LINKS_Name = "Launch Reactor",
  22.                             LINKID_DataType = "Number",
  23.                             INPID_InputControl = "ButtonControl",
  24.                             INP_Integer = false,
  25.                             BTNCS_Execute = [=[--[[--
  26. Open Reactor... menu item - v3.14 2019-10-05
  27. By Andrew Hazelden <andrew@andrewhazelden.com>
  28. --]]--
  29.  
  30. -- This GitLab based Project ID is used to download "Reactor.lua"
  31. -- Reactor GitLab Project ID
  32. local reactor_project_id = "5058837"
  33.  
  34. -- Reactor GitLab Test Repo Project ID
  35. -- local reactor_project_id = "5273696"
  36.  
  37. -- The release_mode is used to toggle Reactor between a "public" vs "dev" state.
  38. -- In the "public" mode a GitLab Token ID is not required.
  39. local release_mode = "public"
  40. -- local release_mode = "dev"
  41.  
  42. local branch = os.getenv("REACTOR_BRANCH")
  43. if branch == nil then
  44.     branch = "master"
  45. end
  46.  
  47. ffi = require "ffi"
  48. curl = require "lj2curl"
  49. ezreq = require "lj2curl.CRLEasyRequest"
  50.  
  51.  
  52. local separator = package.config:sub(1,1)
  53. -- Check for a pre-existing PathMap preference
  54. local reactor_existing_pathmap = app:GetPrefs("Global.Paths.Map.Reactor:")
  55. if reactor_existing_pathmap and reactor_existing_pathmap ~= "nil" then
  56.     -- Clip off the "reactor_root" style trailing "Reactor/" subfolder
  57.     reactor_existing_pathmap = string.gsub(reactor_existing_pathmap, "Reactor" .. separator .. "$", "")
  58. end
  59. local reactor_pathmap = os.getenv("REACTOR_INSTALL_PATHMAP") or reactor_existing_pathmap or "AllData:"
  60. local local_system = os.getenv("REACTOR_LOCAL_SYSTEM")
  61. local path = app:MapPath(tostring(reactor_pathmap) .. "Reactor/System/")
  62. local destFile = path .. "Reactor.lua"
  63. bmd.createdir(path)
  64.  
  65. local config = bmd.readfile(path .. "Reactor.cfg")
  66.  
  67. local token = config and ((config.Repos and config.Repos._Core and config.Repos._Core.Token) or (config.Settings and config.Settings.Reactor and config.Settings.Reactor.Token))
  68.  
  69. -- Skip checking for the GitLab Token ID when Reactor is running in the public mode.
  70. if not token and release_mode ~= "public" then
  71.     error("[Reactor Error] No private GitLab token was found in the config file. Please edit " .. path .. "Reactor.cfg and add your token.")
  72. end
  73.  
  74. if local_system then
  75.     local file = io.open(local_system .. separator .. "Reactor.lua", "r")
  76.     local str = nil
  77.  
  78.     if file then
  79.         str = file:read("*all")
  80.         file:close()
  81.     else
  82.         print("[Reactor Error] Disk permissions error reading local_system path ", local_system)
  83.         os.exit()
  84.     end
  85.  
  86.     file = io.open(destFile, "w")
  87.     if file then
  88.         file:write(str)
  89.         file:close()
  90.         ldofile(fusion:MapPath(destFile))
  91.     else
  92.         print("[Reactor Error] Disk permissions error when saving: ", destFile)
  93.         os.exit()
  94.     end
  95. else
  96.     local url = "https://gitlab.com/api/v4/projects/" .. reactor_project_id .. "/repository/files/System%2FReactor%2Elua/raw?ref=" .. branch
  97.  
  98.     if token then
  99.         url = url .. "&private_token=" .. token
  100.     end
  101.  
  102.     local file = io.open(destFile, "r")
  103.     local doFetch = true -- file == nil or file:read(1) == nil
  104.  
  105.     if file then
  106.         file:close()
  107.     end
  108.  
  109.     if doFetch then
  110.         local req = ezreq(url)
  111.  
  112.         local body = {}
  113.  
  114.         req:setOption(curl.CURLOPT_SSL_VERIFYPEER, 0)
  115.         req:setOption(curl.CURLOPT_WRITEFUNCTION, ffi.cast("curl_write_callback",
  116.             function(buffer, size, nitems, userdata)
  117.                 table.insert(body, ffi.string(buffer, size*nitems))
  118.                 return nitems;
  119.             end))
  120.  
  121.         ok, err = req:perform()
  122.         if ok then
  123.             -- Check if the Reactor.lua file was downloaded correctly
  124.             if table.concat(body) == [[{"message":"401 Unauthorized"}]] then
  125.                 error("[Reactor Download Failed] 401 Unauthorized\n\n[Pro Tip] You should double check that you are syncing with the Reactor public repository in your \"Config:/Reactor.fu\" and \"Reactor:/System/Reactor.cfg\" files.")
  126.             elseif table.concat(body) == [[{"message":"404 Project Not Found"}]] then
  127.                 error("[Reactor Download Failed] 404 GitLab Project Not Found\n\n[Pro Tip] You should double check that you are syncing with the Reactor public repository in your \"Config:/Reactor.fu\" and \"Reactor:/System/Reactor.cfg\" files.")
  128.             elseif table.concat(body) == [[{"message":"404 File Not Found"}]] then
  129.                 error("[Reactor Download Failed] 404 File Not Found\n\n[Pro Tip] The main Reactor GitLab file has been renamed. Please download and install a new Reactor Installer script or you can try manually installing the latest Reactor.fu file.")
  130.             elseif table.concat(body) == [[{"error":"invalid_token","error_description":"Token was revoked. You have to re-authorize from the user."}]] then
  131.                 error("[Reactor Download Failed] GitLab TokenID Revoked Error\n\n[Pro Tip] Your GitLab TokenID has been revoked. Please enter a new TokenID value in your Reactor.cfg file, or switch to the Reactor Public repo and remove your existing Reactor.cfg file.")
  132.             elseif table.concat(body) == [[{"message":"404 Commit Not Found"}]] then
  133.                 error("[Reactor Download Failed] GitLab Previous CommitID Empty Error\n\n[Pro Tip] Please remove your existing Reactor.cfg file and try again. Alternativly, you may have a REACTOR_BRANCH environment variable active and it is requesting a branch that does not exist.")
  134.             elseif table.concat(body) == [[{"error":"insufficient_scope","error_description":"The request requires higher privileges than provided by the access token.","scope":"api"}]] then
  135.                 error("[Reactor Download Failed] GitLab TokenID Permissions Scope Error\n\n[Pro Tip] Your GitLab TokenID privileges do not grant you access to this repository.")
  136.             else
  137.                 local file = io.open(destFile, "w")
  138.                 if file then
  139.                     file:write(table.concat(body))
  140.                     file:close()
  141.                     ldofile(fusion:MapPath(destFile))
  142.                 else
  143.                     print("[Reactor Error] Disk permissions error when saving: ", destFile)
  144.                 end
  145.             end
  146.         else
  147.             print("[Reactor Error] Fetch Failed: ", err)
  148.         end
  149.     else
  150.         ldofile(fusion:MapPath(destFile))
  151.     end
  152. end
  153. ]=],
  154.                             ICS_ControlPage = "Controls"
  155.                         }
  156.                     }
  157.                 }
  158.             },
  159.         }
  160.     },
  161.     ActiveTool = "LaunchReactor"
  162. }

User avatar
SecondMan
Site Admin
Posts: 4243
Joined: Thu Jul 31, 2014 5:31 pm
Answers: 15
Location: Vancouver, Canada
Been thanked: 62 times
Contact:

Re: How to start Reactor once installed?

#5

Post by SecondMan » Mon Feb 24, 2020 12:29 pm

Just add a hotkey of your choice. Reactor has a default hotkey of CTRL-F16 but for the life of me I don't even know what combination of keys that is on my Windows laptop.

Put the below Open Reactor.fu file in your Config folder (on Windows/Resolve that would be something like C:\ProgramData\Blackmagic Design\DaVinci Resolve\Fusion\Config) and you're done. This maps ALT-R to open Reactor, but you can adjust to your wants and desires...
Code: [Select all] [Expand/Collapse] [Download] (Open Reactor.fu)
  1. --[[--
  2. Opens Reactor with Alt-R hotkey
  3. --]]--
  4.  
  5. {
  6.  
  7.     Hotkeys
  8.     {
  9.         Target = "FuFrame",
  10.        
  11.         ALT_R = "RunScript{filename = 'Reactor:/System/Scripts/Comp/Reactor/Open Reactor....lua'}",
  12.     },
  13.  
  14. }

User avatar
SirEdric
Fusionator
Posts: 2276
Joined: Tue Aug 05, 2014 10:04 am
Answers: 9
Real name: Eric Westphal
Been thanked: 32 times
Contact:

Re: How to start Reactor once installed?

#6

Post by SirEdric » Mon Feb 24, 2020 12:43 pm

SecondMan wrote:
Mon Feb 24, 2020 12:29 pm
Reactor has a default hotkey of CTRL-F16 but for the life of me I don't even know what combination of keys that is on my Windows laptop.
Hmmm....even my regular keyboard maxes out at F12.
Spinal tap comes to mind: 'My F-Keys go up to 16...:-))

User avatar
SecondMan
Site Admin
Posts: 4243
Joined: Thu Jul 31, 2014 5:31 pm
Answers: 15
Location: Vancouver, Canada
Been thanked: 62 times
Contact:

Re: How to start Reactor once installed?

#7

Post by SecondMan » Mon Feb 24, 2020 1:07 pm

Yes, SHIFT-F1 is then supposed to be F13 and so forth, but it doesn't seem to work for me...

ALT-R FTW! :)

User avatar
SecondMan
Site Admin
Posts: 4243
Joined: Thu Jul 31, 2014 5:31 pm
Answers: 15
Location: Vancouver, Canada
Been thanked: 62 times
Contact:

Re: How to start Reactor once installed?

#8

Post by SecondMan » Mon Feb 24, 2020 4:33 pm

Actually, scratch that. Reactor adds Action items already that you can bind hotkeys against. In Fusion that is. In Resolve - as far as I can tell - you can bind hotkeys to scripts, but not the Action items...? Anyway, it works for our purposes here.

Here's where you can find that in Resolve:

Image

Image

Select All Commands under Commands, and type Reactor in the search field to quickly find it. As you can see, ALT-R is already taken, and good luck finding any combination with R available... :)