Bug: Unimplemented functions in Workflow Integration API

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

jonnyhyman

  • Posts: 13
  • Joined: Fri Apr 02, 2021 6:37 pm
  • Real Name: Jonny Hyman

Bug: Unimplemented functions in Workflow Integration API

PostThu Feb 02, 2023 2:05 am

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:
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
Offline

jonnyhyman

  • Posts: 13
  • Joined: Fri Apr 02, 2021 6:37 pm
  • Real Name: Jonny Hyman

Re: Bug: Unimplemented functions in Workflow Integration API

PostThu Dec 14, 2023 7:44 pm

Bumping as 10 months later it would still be great to get full Fusion access from the Workflow Integration API!

Appears others are looking for similar functionality: https://forum.blackmagicdesign.com/viewtopic.php?f=12&t=189737
DaVinci Resolve 18 Studio, latest build always :)
MacBook Pro, 2.6GHz 6-Core i7, 64GB RAM, AMD Radeon Pro 5600M 8GB
Offline
User avatar

Igor Riđanović

  • Posts: 1596
  • Joined: Thu Jul 02, 2015 5:11 am
  • Location: Los Angeles, Calif.

Re: Bug: Unimplemented functions in Workflow Integration API

PostFri Dec 29, 2023 5:59 pm

Timeline item properties as well as Fusion comp elements are very accessible from the Lua/Python API. In fact you can do way more with Fusion then with Resolve proper. Look up Fusion 8 Scripting Guide.
www.metafide.com - DaVinci Resolve™ Apps

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 21 guests