Batch Parameter Changer — A Rewrite for Fusion 9

User avatar
Midgardsormr
Fusionator
Posts: 1318
Joined: Wed Nov 26, 2014 8:04 pm
Answers: 6
Location: Los Angeles, CA, USA
Been thanked: 120 times
Contact:

Re: Batch Parameter Changer — A Rewrite for Fusion 9

#16

Post by Midgardsormr » Fri May 25, 2018 7:42 am

emill wrote:But when I selected a few nodes and tried running the script (drag n drop into Console) I just got:
...\Reactor\Deploy\Scripts\Comp\Batch_Change_Parameters.lua:28: attempt to call field 'isin' (a nil value)
It should show up in the Script menu. Sounds like maybe your Scripts Path Map is incorrect. Go to File > Preferences, then Global and Default Settings > Path Map

What is in the Scripts: and UserPaths: maps?

bmd.isin() is in the scriptlib file that resides in Fusion's Scripts directory. If the Path Map is wrong, not only will Fusion not find the installed scripts, it also won't find that scriptlib with its included functions.

User avatar
emill
Posts: 5
Joined: Thu Nov 02, 2017 7:31 am
Contact:

Re: Batch Parameter Changer — A Rewrite for Fusion 9

#17

Post by emill » Thu May 31, 2018 11:59 pm

Oh, that expains. I had Scripts Path Mapped (only) to our shared network drive. Changed it to include UserPaths:Scripts as well and all is working fine (so basically I did: "\\server\path\to\shared\scripts" -----> "UserPaths:Scripts;\\server\path\to\shared\scripts").

In a quick test the Batch Parameter Changer works. For usabilitys sake I'd like to be able to set values with a slider as well as just typing them in, though.

User avatar
illusion0927
Posts: 1
Joined: Wed Oct 17, 2018 7:42 am

Re: Batch Parameter Changer — A Rewrite for Fusion 9

#18

Post by illusion0927 » Tue Sep 17, 2019 12:47 pm

In Resolve 16 it not work......will this updata to Resolve 16????


User avatar
Midgardsormr
Fusionator
Posts: 1318
Joined: Wed Nov 26, 2014 8:04 pm
Answers: 6
Location: Los Angeles, CA, USA
Been thanked: 120 times
Contact:

Re: Batch Parameter Changer — A Rewrite for Fusion 9

#19

Post by Midgardsormr » Tue Sep 17, 2019 3:20 pm

I don't have the time for it at the moment, but I totally don't mind if anybody else wants to take a crack at updating for Resolve compatibility. If you do so, I'd appreciate it if you'd share your findings on what the differences are here so we can all learn more!


User avatar
AndrewHazelden
Fusionator
Posts: 1548
Joined: Fri Apr 03, 2015 3:20 pm
Answers: 8
Location: West Dover, Nova Scotia, Canada
Been thanked: 102 times
Contact:

Re: Batch Parameter Changer — A Rewrite for Fusion 9

#20

Post by AndrewHazelden » Sun Oct 27, 2019 4:45 am

Midgardsormr wrote:
Tue Sep 17, 2019 3:20 pm
I don't have the time for it at the moment, but I totally don't mind if anybody else wants to take a crack at updating for Resolve compatibility. If you do so, I'd appreciate it if you'd share your findings on what the differences are here so we can all learn more!
Hi @Midgardsormr.

If you had the old version 2.0 release of Batch_Change_Parameters.lua installed via Reactor for Resolve v15/16, you could have made the script work successfully by adding the "Resolve Essentials" atom package which slips a copy of "bmd.scriptlib" into Resolve at the Reactor:/Deploy/Scripts/bmd.scriptlib PathMap location.

Change Log

v2.1, 2019-10-27

Updated to add a copy of "bmd.isin()" function that was renamed to "bcIsIn()" so the script can run succesfully in Resolve where the "bmd.scriptlib" file does not exist. Added a TargetID value to the UI Manager window so pressing "Ctrl + W" closes the window instead of the composite.
Code: [Select all] [Expand/Collapse] [Download] (Batch_Change_Parameters.lua)
  1. -- Batch Change Parameters v2.1 for Fusion v9-16.1+ and Resolve v15-16.1+
  2.  
  3. -- Changes parameters for multiple selected tools simultaneously. The tools need not be of the
  4. -- same type, but only Inputs that they have in common can be changed.
  5.  
  6. -- Concept by Gringo
  7. -- v1.0 by SlayerK, 2007/02/22
  8. -- v2.0 by Bryan Ray for MuseVFX
  9. -- v2.1 by Andrew Hazelden for Reactor
  10.  
  11. -- Change Log:
  12.     -- v2.1, 2019-10-27, updated to add a copy of "bmd.isin()" function that was renamed to "bcIsIn()" so the script can run in Resolve where the "bmd.scriptlib" file does not exist. Added a TargetID value to the UI Manager window so pressing "Ctrl + W" closes the window instead of the composite.
  13.     -- v2.0, 2018-01-22, updated for Fusion 9 and UI Manager. Cleaned code and added documentation.
  14.     --      Removed orphan and redundant functions. Removed un-implemented math operations code.
  15.     -- v1.0, 2007-02-22, initial release
  16.  
  17. -- Development Roadmap:
  18. --      Add option for performing arithmetic on the Inputs. For instance, add 0.3 to the current
  19. --          value of each Input.
  20.  
  21. -- /////////////////////
  22. -- / Utility Functions /
  23. -- /////////////////////
  24.  
  25. -- bcIsIn(t, val) scans table t and returns true if the string val is
  26. -- found in the table. Copied from bmd.scriptlib for Resolve compatibility
  27. function bcIsIn(t, val)
  28.     if type(t) == "table" then
  29.         for i,v in pairs(t) do
  30.             if (type(v) == "string") and (type(val) == "string") then
  31.                 if string.lower(v) == string.lower(val) then
  32.                     return true
  33.                 end
  34.             else
  35.                 if v == val then
  36.                     return true
  37.                 end
  38.             end
  39.         end
  40.     end
  41.  
  42.     return false
  43. end
  44.  
  45.  
  46. -- Clears Modifiers from a list of tools. allToolsNames is a global table containing a list of
  47. -- all Tools available in Fusion.
  48. function clearModifiers(tbl)
  49.     local out = {}
  50.     for i = 1, table.getn(tbl) do
  51.         if bcIsIn(allToolsNames, tbl[i]:GetAttrs().TOOLS_RegID) then
  52.             table.insert(out, tbl[i])
  53.         end
  54.     end
  55.     return out
  56. end
  57.  
  58. -- Finds the tool in the supplied list with the smallest number of Inputs and returns that tool's index.
  59. function getMin(tbl)
  60.     if table.getn(tbl)==0 then
  61.         -- If there are no items in the table, throw an error.
  62.         return(-1)
  63.     end
  64.  
  65.     local minTool = 0
  66.     local minInputs = math.huge
  67.     numInputs = 0
  68.  
  69.     for i=1, table.getn(tbl) do
  70.         numInputs = table.getn(tbl[i]:GetInputList())
  71.         if numInputs<minInputs then
  72.             minTool=i
  73.             minInputs=numInputs
  74.         end
  75.     end
  76.     return minTool
  77. end
  78.  
  79. -- Returns a table containing a list of a tool's inputs' types, ids and names.
  80. function getInputInfo(tool)
  81.     local tbl = tool:GetInputList()
  82.     local out = {}
  83.     local attrs = {}
  84.     local name = ""
  85.     local iID = ""
  86.     local iType = ""
  87.     for i, j in ipairs(tbl) do
  88.         attrs = j:GetAttrs()
  89.         name = attrs.INPS_Name
  90.         iID = attrs.INPS_ID
  91.         iType = attrs.INPS_DataType
  92.         if (attrs.INPB_Passive == false) and (bcIsIn(supp_types, iType) == true) then
  93.             table.insert(out, {tp=iType, id=iID, nm=name})
  94.         end
  95.     end
  96.     return out
  97. end
  98.  
  99.  
  100. -- Compares the entries in two tables and returns a table containing all entries that are in both.
  101. -- Look into generalizing this function.
  102. function intersect(tblA, tblB)
  103.     if type(tblA)~="table" then
  104.         return nil
  105.     end
  106.  
  107.     local out = {}
  108.     for i = 1, table.getn(tblB) do
  109.         flag = false
  110.         for j = 1, table.getn(tblA) do
  111.             if(tblB[i].id == tblA[j].id) and (tblB[i].nm == tblA[j].nm) and (tblB[i].tp == tblA[j].tp) then
  112.                 flag = true
  113.             end
  114.         end
  115.         if flag == true then
  116.             table.insert(out, tblB[i])
  117.         end
  118.     end
  119.  
  120.     return out
  121. end
  122.  
  123. -- tools is a global table. Returns the contents in string form of the chosen parameter. If the
  124. -- current value of all selected tools is not identical, returns "?" instead. Used to pre-fill
  125. -- the Value text entry field.
  126. function getParameter(pID)
  127.     local new = 0
  128.     local inputNumber = getInputNumber(pID, tools[1])
  129.     local value = tools[1]:GetInputList()[inputNumber][comp.CurrentTime]
  130.  
  131.     for i = 2, table.getn(tools) do
  132.         inputNumber = getInputNumber(pID, tools[i])
  133.         new = tools[i]:GetInputList()[inputNumber][comp.CurrentTime]
  134.         if compareValues(new, value) == false then
  135.             return "?"
  136.         end
  137.     end
  138.  
  139.     if type(value) == "number" then
  140.         return tostring(value)
  141.     end
  142.  
  143.     if type(value) == "table" then
  144.         return value
  145.     end
  146.  
  147.     if type(value) == "string" then
  148.         return value
  149.     end
  150.  
  151.     return "?"
  152. end
  153.  
  154. -- Given information about an input and a tool, returns the index of an input matching the info.
  155. function getInputNumber(inputInfo, tool)
  156.     local inputs = {}
  157.     inputs = tool:GetInputList()
  158.     local attrs
  159.     for i,j in ipairs(inputs) do
  160.         attrs = j:GetAttrs()
  161.         if (attrs.INPS_Name == inputInfo.nm) and
  162.             (attrs.INPS_ID == inputInfo.id) and
  163.             (attrs.INPS_DataType == inputInfo.tp) then
  164.             return i
  165.         end
  166.     end
  167.     return -1
  168. end
  169.  
  170. -- Compares two values. If they are identical, returns true. Otherwise, returns false.
  171. function compareValues(v1,v2)
  172.     if type(v1) ~= type(v2) then
  173.         return false
  174.     end
  175.  
  176.     if (type(v1)=="number") or (type(v1)=="string") then
  177.         return (v1==v2)
  178.     end
  179.  
  180.     if type(v1)=="table" then
  181.         for i=1, table.getn(v1) do
  182.             if v1[i] ~= v2[i] then
  183.                 return false
  184.             end
  185.         end
  186.         return true
  187.     end
  188.     return false
  189. end
  190.  
  191.  
  192. -- /////////////////////
  193. -- /    UI Manager     /
  194. -- /////////////////////
  195.  
  196. -- Set up UI Manager
  197. local ui = fu.UIManager
  198. local disp = bmd.UIDispatcher(ui)
  199. local width,height = 400,200
  200.  
  201. -- Define the Window
  202. win = disp:AddWindow({
  203.     ID = 'BCWin',
  204.     TargetID = 'BCWin',
  205.     WindowTitle = 'Batch Parameter Changer',
  206.     Geometry = {800,200,600,340},
  207.     Spacing = 10,
  208.  
  209.     ui:VGroup{
  210.         ID = 'root',
  211.         Weight = 1.0,
  212.         ui:HGroup{
  213.             Weight = 0,
  214.             ui:Label{
  215.                 ID = 'paramLabel',
  216.                 Text = 'Choose Parameter:',
  217.                 Weight = 0,
  218.             },
  219.         },
  220.         ui:VGap(3),
  221.         ui:HGroup{
  222.             Weight = 0,
  223.             ui:HGap(53),
  224.             ui:ComboBox{
  225.                 ID = 'Parameter',
  226.                 Text = 'Choose Parameter',
  227.                 Weight = 1,
  228.             },
  229.         },
  230.         ui:VGap(30),
  231.         ui:HGroup{
  232.             Weight = 0,
  233.             ui:Label{
  234.                 ID = 'setLabel',
  235.                 Text = 'Set To:',
  236.             },
  237.         },
  238.         ui:VGap(10),
  239.         ui:HGroup{
  240.             Weight = 0,
  241.             ui:Label{
  242.                 ID = 'dataTypeLabel',
  243.                 Text = 'dataType',
  244.                 Weight = 0,
  245.                 Visible = true,
  246.             },
  247.             ui:LineEdit{
  248.                 ID = 'textFld',
  249.                 Text = 0,
  250.                 Visible = true,
  251.             },
  252.         },
  253.         ui:HGroup{
  254.             Weight = 0,
  255.             ui:HGap(53),
  256.             ui:ComboBox{
  257.                 ID = 'listFuID',
  258.                 Text = '',
  259.                 Weight = 1,
  260.                 Visible = true,
  261.             },
  262.         },
  263.         ui:HGroup{
  264.             Weight = 0,
  265.             ui:HGap(36),
  266.             ui:Label{
  267.                 ID = 'xlabel',
  268.                 Text = 'X:',
  269.                 Visible = true,
  270.                 Weight = 0.05,
  271.             },
  272.             ui:LineEdit{
  273.                 ID = 'cordX',
  274.                 Text = '0.5',
  275.                 Visible = true,
  276.                 Weight = 1,
  277.             },
  278.             ui:HGap(20),
  279.             ui:Label{
  280.                 ID = 'ylabel',
  281.                 Text = 'Y:',
  282.                 Visible = true,
  283.                 Weight = 0.05,
  284.             },
  285.             ui:LineEdit{
  286.                 ID = 'cordY',
  287.                 Text = '0.5',
  288.                 Visible = true,
  289.                 Weight = 1,
  290.             },
  291.         },
  292.         ui:VGap(30),
  293.         ui:HGroup{
  294.             ui:Button{
  295.                 ID = 'btn_set',
  296.                 Text = 'Apply',
  297.                 Weight = 1,
  298.             },
  299.         },
  300.     },
  301.  
  302. })
  303.  
  304. -- The window was closed
  305. function win.On.BCWin.Close(ev)
  306.     disp:ExitLoop()
  307. end
  308.  
  309. -- Add your GUI element based event functions here:
  310. itm = win:GetItems() -- Collects a list of fields in the GUI
  311.  
  312.  
  313. -- The app:AddConfig() command that will capture the "Control + W" or "Control + F4" hotkeys so they will close the window instead of closing the foreground composite.
  314. app:AddConfig("BCWin", {
  315.     Target {
  316.         ID = "BCWin",
  317.     },
  318.  
  319.     Hotkeys {
  320.         Target = "BCWin",
  321.         Defaults = true,
  322.  
  323.         CONTROL_W = "Execute{cmd = [[app.UIManager:QueueEvent(obj, 'Close', {})]]}",
  324.         CONTROL_F4 = "Execute{cmd = [[app.UIManager:QueueEvent(obj, 'Close', {})]]}",
  325.     },
  326. })
  327.  
  328.  
  329. -- When an entry is chosen in the Parameter combo box, change the data type label and pre-fill
  330. -- the appropriate data entry field with the current value of the chosen Input, if it's identical
  331. -- on all controls. If it is not, insert "?". Toggle Visible attributes to configure the UI.
  332. function win.On.Parameter.CurrentIndexChanged(ev)
  333.     local index = itm.Parameter.CurrentIndex + 1
  334.     local currentValue = getParameter(controls[index])
  335.     local dataType = controls[index].tp
  336.     local xVal, yVal
  337.     local id = controls[index].id
  338.  
  339.     itm.dataTypeLabel.Text = dataType
  340.  
  341.     if dataType == "Point" then
  342.         if currentValue == "?" then
  343.             currentValue = {"?", "?"}
  344.         else
  345.             xVal = currentValue[1]
  346.             yVal = currentValue[2]
  347.         end
  348.  
  349.         itm.textFld.Visible = false
  350.         itm.listFuID.Visible = false
  351.         itm.xlabel.Visible = true
  352.         itm.ylabel.Visible = true
  353.         itm.cordX.Visible = true
  354.         itm.cordY.Visible = true
  355.         itm.cordX.Text = tostring(xVal)
  356.         itm.cordY.Text = tostring(yVal)
  357.  
  358.     elseif dataType == "FuID" then
  359.         itm.textFld.Visible = false
  360.         itm.listFuID.Visible = true
  361.         itm.xlabel.Visible = false
  362.         itm.ylabel.Visible = false
  363.         itm.cordX.Visible = false
  364.         itm.cordY.Visible = false
  365.  
  366.         itm.listFuID:Clear()
  367.  
  368.         fuIDAttrs = tools[1][id]:GetAttrs()
  369.         inputControlType = string.gsub(fuIDAttrs.INPID_InputControl, "ID", "")
  370.         controlID = "INPIDT_"..inputControlType.."_ID"
  371.         fuIDlist = tools[1][id]:GetAttrs()[controlID]
  372.  
  373.         for i = 1, table.getn(fuIDlist) do
  374.             itm.listFuID:AddItem(fuIDlist[i])
  375.         end
  376.     else
  377.         itm.textFld.Visible = true
  378.         itm.listFuID.Visible = false
  379.         itm.xlabel.Visible = false
  380.         itm.ylabel.Visible = false
  381.         itm.cordX.Visible = false
  382.         itm.cordY.Visible = false
  383.  
  384.         itm.textFld.Text = currentValue
  385.     end
  386. end
  387.  
  388. -- When the Apply button is clicked, set the chosen Parameter on each selected tool. This button
  389. -- does not close the GUI.
  390. function win.On.btn_set.Clicked(ev)
  391.     -- Identify the parameter to be changed, get its datatype and ID.
  392.     local index = itm.Parameter.CurrentIndex + 1
  393.     local dataType = controls[index].tp
  394.     local id = controls[index].id
  395.  
  396.     -- Loop through each entry in the selected tools list.
  397.     for i, j in ipairs(tools) do
  398.  
  399.         -- Selection based on dataType
  400.         if dataType == "Number" then
  401.             -- Get the user-supplied new value
  402.             local newValue = itm.textFld.Text
  403.             -- Check it for valid type
  404.             if tonumber(newValue)==nil then
  405.                 print("Entered data is not a Number")
  406.                 return
  407.             end
  408.             -- Set the chosen input
  409.             j[id][comp.CurrentTime] = tonumber(newValue)
  410.         end
  411.  
  412.         -- Second verse, same as the first, except we don't need to validate the data type.
  413.         if dataType == "Text" then
  414.             local newValue = itm.textFld.Text
  415.             j[id][comp.CurrentTime] = newValue
  416.         end
  417.  
  418.         -- Points are a 3 dimensional value (though the Z value is
  419.         -- very rarely addressed), so we use a table to hold it.
  420.         if dataType == "Point" then
  421.             local newValue = {}
  422.             newValue[1] = tonumber(itm.cordX.Text)
  423.             newValue[2] = tonumber(itm.cordY.Text)
  424.             newValue[3] = 0
  425.             local errFlag = 0
  426.             if tonumber(itm.cordX.Text) == nil then
  427.                 print("X Coordinate data is not a Number")
  428.                 errFlag = 1
  429.             end
  430.             if tonumber(itm.cordY.Text) == nil then
  431.                 print("Y Coordinate data is not a Number")
  432.                 errFlag = 1
  433.             end
  434.             if errFlag == 1 then
  435.                 return
  436.             end
  437.             j[id][comp.CurrentTime] = newValue
  438.         end
  439.  
  440.         -- The combo box uses a different attribute to hold its current
  441.         -- value, but it's otherwise just like the others. No need to test
  442.         -- for valid input since that's enforced by the box itself.
  443.         if dataType == "FuID" then
  444.             local newValue = itm.listFuID.CurrentText
  445.             j[id][comp.CurrentTime] = newValue
  446.         end
  447.     end
  448. end
  449.  
  450. -- //////////////////////////////////
  451. -- /           MAIN CODE            /
  452. -- //////////////////////////////////
  453. function main()
  454.     allTools = {}
  455.     allToolsNames = {}
  456.  
  457.     -- Get a list of all the tools in Fusion's registry
  458.     if globals.__addtool_data then
  459.         allTools = globals.__addtool_data
  460.     else
  461.         allTools = fu:GetRegSummary(CT_Tool)
  462.         globals.__addtool_data = allTools
  463.     end
  464.  
  465.     -- Make a new list containing the REGS_ID of all tools that have all three of name, OpIcon and ID.
  466.     for i,v in ipairs(allTools) do
  467.         if v.REGS_Name~=nil and v.REGS_OpIconString~=nil and v.REGS_ID~=nil then
  468.             table.insert(allToolsNames, v.REGS_ID)
  469.         end
  470.     end
  471.     -- DataTypes supported by this script.
  472.     supp_types = {"Number", "FuID", "Point", "Text",}
  473.     -- List of user-selected tools
  474.     tools = comp:GetToolList(true)
  475.     -- Removes Modifiers from the tool list.
  476.     tools = clearModifiers(tools)
  477.     -- Holds a list of tool REGIDs detected in the tools list
  478.     -- Filters the list for efficiency when building the Parameters table.
  479.     seen={}
  480.  
  481.     -- If fewer than two tools are selected, throw an error.
  482.     if table.getn(tools) < 2 then
  483.         comp:AskUser("You must select more than one tool.\nAborting.", {})
  484.         print("You must select more than one tool.")
  485.         return 0
  486.     end
  487.  
  488.     -- Get the index of the tool with the smallest number of inputs
  489.     minEntry = getMin(tools)
  490.  
  491.     -- Get a list of the inputs in that tool.
  492.     controls = getInputInfo(tools[minEntry])
  493.  
  494.     -- Add the tool type to the seen table
  495.     table.insert(seen, tools[minEntry]:GetAttrs().TOOLS_RegID)
  496.  
  497.     -- Remove the tool from the tool list so it won't be reprocessed
  498.     table.remove(tools, minEntry)
  499.  
  500.     -- Pare down the inputs in the controls table to the inputs common to all selected tools.
  501.     while (table.getn(tools)>0) do -- Loop as long as at least one tool remains in the table.
  502.         -- This loop always processes the tool at index 1 of the tools table.
  503.         -- Check to see if the current tool's RegID has already been processed.
  504.         if bcIsIn(seen, tools[1]:GetAttrs().TOOLS_RegID) == false then
  505.             -- Add the RegID to the seen table
  506.             table.insert(seen, tools[1]:GetAttrs().TOOLS_RegID)
  507.             -- Get info about the tool's Inputs
  508.             iInfo = getInputInfo(tools[1])
  509.             -- Remove any inputs that are not already present in controls
  510.             controls = intersect(controls, iInfo)
  511.         end
  512.         -- Remove the current tool from the list. getn() will be reduced by 1. When no tools remain,
  513.         -- the loop will break.
  514.         table.remove(tools, 1)
  515.     end
  516.  
  517.     -- If no inputs remain in the controls table, the selected tools have no controls in common.
  518.     -- Throw an error.
  519.     if table.getn(controls) == 0 then
  520.         composition:AskUser("No Common Inputs. Aborting.", {})
  521.         print("No common inputs.")
  522.         return 0
  523.     end
  524.  
  525.     -- Alphabetize the controls table.
  526.     table.sort(controls, function(a,b) return (b.nm > a.nm) end)
  527.  
  528.     -- Populate the Parameter combo box
  529.     for i = 1, table.getn(controls) do
  530.         itm.Parameter:AddItem(controls[i].nm)
  531.     end
  532.  
  533.     -- Repopulate the tool list
  534.     tools = comp:GetToolList(true)
  535.     tools = clearModifiers(tools)
  536.  
  537.     return 1
  538. end
  539.  
  540. -- Fill the Parameter combo box and acquire the tool list.
  541. status = main()
  542.  
  543. -- Check for successful execution of main function
  544. if status == 1 then
  545.     -- Activate the window
  546.     win:Show()
  547.     disp:RunLoop()
  548.     win:Hide()
  549. end
  550.  

User avatar
Midgardsormr
Fusionator
Posts: 1318
Joined: Wed Nov 26, 2014 8:04 pm
Answers: 6
Location: Los Angeles, CA, USA
Been thanked: 120 times
Contact:

Re: Batch Parameter Changer — A Rewrite for Fusion 9

#21

Post by Midgardsormr » Sun Oct 27, 2019 7:31 am

Excellent! Thank you, Andrew! And nice touch with the Ctrl+W/Alt+F4 hotkey.

User avatar
AndrewHazelden
Fusionator
Posts: 1548
Joined: Fri Apr 03, 2015 3:20 pm
Answers: 8
Location: West Dover, Nova Scotia, Canada
Been thanked: 102 times
Contact:

Re: Batch Parameter Changer — A Rewrite for Fusion v9-16.1.1+

#22

Post by AndrewHazelden » Sun Nov 17, 2019 5:56 am

Hi @Midgardsormr.

I posted an updated version 3 copy of Batch Parameter Changer that works better in Fusion v9-16.1.1+ and Resolve v15-16.1.1+.

Changes:
  • Added error handling for several nil return values from "fuIDlist" and "uIDAttrs.INPID_InputControl" that caused "gusb()" error messages in the Console.
  • Adjusted UI Manager GUI weight values to fix Fusion/Resolve v16 GUI rendering issues.
Here is the GitLab web-accessible version of the file that is in Reactor:
https://gitlab.com/WeSuckLess/Reactor/b ... meters.lua

I still need to look at line 464 of the code to fix an issue which is commented out at the moment with globals.__addtool_data usage breaking the script on Fusion v16.1.1. Since that code chunk is commented out the rest of the script works fine but I need to investigate why it's a source of issues.

User avatar
stwert
Posts: 20
Joined: Wed May 23, 2018 7:09 am

Re: Batch Parameter Changer — A Rewrite for Fusion 9

#23

Post by stwert » Wed Dec 04, 2019 2:03 pm

Hi Bryan (and Andrew),
First off, great tool that provides functionality that Fusion should natively have!
Apologies if this has been brought up already, but I notice that there are a lot of duplicates for parameters, presumably because there are the same parameter names in different inspector pages or areas that do different things. I wonder if there's a way to prefix the
page/section/subsection where necessary? Just an idea.


Edit: Perhaps a simpler way would be in cases of duplicates, add in parentheses the actual parameter name e.g. Size (LayoutSize)

User avatar
Midgardsormr
Fusionator
Posts: 1318
Joined: Wed Nov 26, 2014 8:04 pm
Answers: 6
Location: Los Angeles, CA, USA
Been thanked: 120 times
Contact:

Re: Batch Parameter Changer — A Rewrite for Fusion 9

#24

Post by Midgardsormr » Wed Dec 04, 2019 2:44 pm

That's a good idea. I've been meaning to go back into this one and make it prettier for a while. I've learned so much about UI Manager since I did it, and I was never very happy with it to start with. I'd also like to implement some of the features that were vestigial in the original script, like the ability to make a relative adjustment—for example, to add a constant to each parameter instead of just setting them all to the same value. Maybe present the params as a list instead of putting them in a combo box.

User avatar
SecondMan
Site Admin
Posts: 3799
Joined: Thu Jul 31, 2014 5:31 pm
Answers: 8
Location: Vancouver, Canada
Been thanked: 149 times
Contact:

Re: Batch Parameter Changer — A Rewrite for Fusion 9

#25

Post by SecondMan » Wed Dec 04, 2019 2:54 pm

stwert wrote:
Wed Dec 04, 2019 2:03 pm
First off, great tool that provides functionality that Fusion should natively have!
I beg to differ. This is exactly the kind of functionality that should be provided by an external script. Whether that is authored by Fusion dev or by a third party is not that important.

Remember the Edit Controls... script? That's now native. It's a regression on features and we can't do anything about it now. Well, we can, but no one is doing that right now because it's not that trivial. But if that were still a script, I bet you that by now we would have been able to delete controls with it, for example.

The fact that you can ask for additional functionality in the Batch Parameter Changer on this forum proves my point exactly.