
- Posts: 10
- Joined: Fri Apr 02, 2021 6:37 pm
- Real Name: Jonny Hyman
I'm building a Workflow Integration Plugin and have discovered an issue with the JavaScript API where it connects to the Fusion API
Replication
0) Launch the Sample Project included in the Resolve Developer Documentation
1) Open the JavaScript Console (Cmd + Opt + I)
2) Add an empty Fusion Composition to an empty Timeline
3) In the Sample Plugin's JavaScript Workflow Code, execute:
Which raises the Exception:
Likewise, querying GetToolList:
or querying GetToolList with a regid:
raises:
Interestingly, any time that FindTool is called on a Tool that actually does not exist in the Fusion graph,
The function evaluates but returns an empty string!
This is almost certainly an API limitation/bug I've stumbled on, which happens to make what I want to do impossible.
My guess is there isn't any glue code between the Lua tables / Python dicts that are supposed to be returned and the Javascript API, since it was made more for Media Management than for Timeline manipulation.
Well, I'm here to say that I'd love some deeper control over the Fusion nodes from the API!
Alternatively, if we could just get access to the Effects tab of a timeline clip from the Resolve API, I could just modify the Macro variables I want to modify from there. Unfortunately, there's no Effects manipulation from the API as it stands (right???)
Best,
Jonny Hyman
http://www.jonnyhyman.com
Replication
0) Launch the Sample Project included in the Resolve Developer Documentation
1) Open the JavaScript Console (Cmd + Opt + I)
2) Add an empty Fusion Composition to an empty Timeline
3) In the Sample Plugin's JavaScript Workflow Code, execute:
- Code: Select all
const WorkflowIntegration = require('./WorkflowIntegration.node');
WorkflowIntegration.Initialize("com.blackmagicdesign.resolve.sampleplugin");
time = WorkflowIntegration.GetResolve().GetProjectManager().GetCurrentProject().GetCurrentTimeline();
comp = time.GetCurrentVideoItem().GetFusionCompByIndex(1);
tool = comp.FindTool("MediaOut1");
Which raises the Exception:
- Code: Select all
Uncaught Error: FindTool: ParseProxyObject - function list is empty
at eval (eval at Execute (app.js:4), <anonymous>:5:13)
at Execute (app.js:4)
at HTMLInputElement.onclick (index.html:51)
eval @ VM65:5
Execute @ app.js:4
onclick @ index.html:51
Likewise, querying GetToolList:
- Code: Select all
const WorkflowIntegration = require('./WorkflowIntegration.node');
WorkflowIntegration.Initialize("com.blackmagicdesign.resolve.sampleplugin");
time = WorkflowIntegration.GetResolve().GetProjectManager().GetCurrentProject().GetCurrentTimeline();
comp = time.GetCurrentVideoItem().GetFusionCompByIndex(1);
tool = comp.GetToolList();
or querying GetToolList with a regid:
- Code: Select all
const WorkflowIntegration = require('./WorkflowIntegration.node');
WorkflowIntegration.Initialize("com.blackmagicdesign.resolve.sampleplugin");
time = WorkflowIntegration.GetResolve().GetProjectManager().GetCurrentProject().GetCurrentTimeline();
comp = time.GetCurrentVideoItem().GetFusionCompByIndex(1);
tool = comp.GetToolList(false, "MediaOut")
raises:
- Code: Select all
Uncaught Error: Execute: Exception occured while performing operation
at eval (eval at Execute (app.js:4), <anonymous>:5:13)
at Execute (app.js:4)
at HTMLInputElement.onclick (index.html:51)
Interestingly, any time that FindTool is called on a Tool that actually does not exist in the Fusion graph,
- Code: Select all
const WorkflowIntegration = require('./WorkflowIntegration.node');
WorkflowIntegration.Initialize("com.blackmagicdesign.resolve.sampleplugin");
time = WorkflowIntegration.GetResolve().GetProjectManager().GetCurrentProject().GetCurrentTimeline();
comp = time.GetCurrentVideoItem().GetFusionCompByIndex(1);
tool = comp.FindTool("PeterChamberlainHELPlol")
console.log(tool)
console.log(tool == "")
The function evaluates but returns an empty string!
- Code: Select all
""
true
This is almost certainly an API limitation/bug I've stumbled on, which happens to make what I want to do impossible.

My guess is there isn't any glue code between the Lua tables / Python dicts that are supposed to be returned and the Javascript API, since it was made more for Media Management than for Timeline manipulation.
Well, I'm here to say that I'd love some deeper control over the Fusion nodes from the API!
Alternatively, if we could just get access to the Effects tab of a timeline clip from the Resolve API, I could just modify the Macro variables I want to modify from there. Unfortunately, there's no Effects manipulation from the API as it stands (right???)
Best,
Jonny Hyman
http://www.jonnyhyman.com
DaVinci Resolve 18 Studio, latest build always 
MacBook Pro, 2.6GHz 6-Core i7, 64GB RAM, AMD Radeon Pro 5600M 8GB

MacBook Pro, 2.6GHz 6-Core i7, 64GB RAM, AMD Radeon Pro 5600M 8GB