Script: Class Browser for DaVinci Resolve/Fusion

Get answers to your questions about color grading, editing and finishing with DaVinci Resolve.
  • Author
  • Message
Offline
User avatar

roger.magnusson

  • Posts: 1356
  • Joined: Wed Sep 23, 2015 4:58 pm

Script: Class Browser for DaVinci Resolve/Fusion

PostSun Feb 23, 2020 3:38 pm

An invaluable tool when creating GUI:s for Resolve/Fusion scripts is the FusionScript Help Browser by Andrew Hazelden (also available in Reactor for Fusion and Resolve). It uses the built-in script help/documentation system in Fusion/Resolve and displays it in an easy to use way.

I always wanted two more features though:
  • Clearly identify a class member as a property or a method
  • A graphical representation of the class hierarchy
I added these two features and some other small stuff that I haven't seen done in other scripts.

Startup time is a few seconds slower than Andrews script since I'm putting all the classes in a Tree instead of the faster ComboBox. Once it's started performance is not an issue though.

Note that Resolve kidnaps the keyboard in certain scenarios. Up/Down arrows in the class tree won't work if the script is opened on the Edit page for example. This only affects Resolve, not Fusion. If you need to use the keyboard you can make the Class Browser window a modal window (see the create_window function).

The filtering functionality is set to "contains" but you can use wildcards (* and ?). To list all classes that starts with "UI" just type UI* and press enter (note that classes might be hidden by the "Hide Classes Without Members" checkbox even when filtering).

One thing to note is that sometimes a property says Read-only when you might assume it's Read-write, like UITreeItem.Text. That's because the property is an indexer to a collection of values. The collection is Read-only, but the individual values inside it are Read-write.



Image
Class Browser in Flat View mode


Image
Nested View, with a filter applied to show all classes starting with "UI"


Image
New in v1.1, Registry Attributes for Fusion classes


@BMD, it would be very helpful if the existing Resolve API documentation (readme.txt) was added to the built-in script help system instead of the separate text file. Fusion has many class members documented like this and even Fairlight has some as well. The Resolve readme.txt implies this is already available in the script system, but it's only a list of method names without any description.

Running the script

Unzip the file first (the forum doesn't allow the .lua file extension). The easiest way to run the script is to drag and drop it on the console. To open the console go to the Workspace menu and select Console.

Image


To add the script to the Workspace > Scripts menu, place the script in this folder:
  • Linux
    ~/.local/share/DaVinciResolve/Fusion/Scripts/Comp

  • macOS
    ~/Library/Application Support/Blackmagic Design/DaVinci Resolve/Fusion/Scripts/Comp

  • Windows
    %AppData%\Blackmagic Design\DaVinci Resolve\Support\Fusion\Scripts\Comp
Tested on CentOS 7.6, macOS Catalina, Windows 10 v1909. Resolve v16.1.2 (free and Studio versions), Fusion Studio v16.1.1. Fusion v9 works but might have some visual glitches.

Any feedback is welcome!

Release notes

v1.2.2 2020-05-14
  • Fixed: The Plugins path was incorrect for Fusion on Windows

v1.2.1 2020-05-13
  • New: Additional properties discovered automatically
  • New: Several more files are probed for methods and properties
  • Fixed: Some PreviewControl classes weren't showing in the nested view

v1.2 2020-05-10
  • New: Tag Maps and Enum Maps
  • New: Additional methods that aren't documented in the help system are now discovered automatically
  • Fixed: Fusion v9 window layout issue
  • Fixed: Fusion v9 didn't show property types when available
  • Fixed: Fusion v9 error when registry entries contained tables, added workaround for dumptostring() bug

v1.1 2020-04-02
  • Added support for showing Fusion registry entries associated with a class
  • Registry attributes have tooltips with descriptions from the Fusion 8 Scripting Guide

v1.0 2020-02-23
  • First!
Attachments
Class Browser 1.2.2.zip
(15.65 KiB) Downloaded 52 times
Class Browser 1.2.zip
(14.72 KiB) Downloaded 31 times
Class Browser 1.1.zip
(10.22 KiB) Downloaded 43 times
Last edited by roger.magnusson on Thu May 14, 2020 10:55 am, edited 6 times in total.
Offline
User avatar

Igor Riđanović

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

Re: Script: Class Browser for DaVinci Resolve/Fusion

PostSun Feb 23, 2020 6:19 pm

Very nice. I'll test it out for sure.

Sent from my S60 using Tapatalk
www.metafide.com - DaVinci Resolve™ Apps
Offline
User avatar

Igor Riđanović

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

Re: Script: Class Browser for DaVinci Resolve/Fusion

PostSun Feb 23, 2020 10:04 pm

Nice work. It works in Windows 10. I haven't had much time to explore though. Windows users can also drop the script in
Code: Select all
%AppData%\Blackmagic Design\DaVinci Resolve\Support\Fusion\Scripts\Comp

and it will be permanently available under Workspace/Scripts dropdown menu (v16) or Fusion/Scripts in V15.
www.metafide.com - DaVinci Resolve™ Apps
Offline
User avatar

iddos-l

  • Posts: 386
  • Joined: Sat Mar 30, 2019 7:55 pm
  • Real Name: iddo lahman

Re: Script: Class Browser for DaVinci Resolve/Fusion

PostMon Feb 24, 2020 7:07 am

Great stuff!
Tested on mac Mojave resolve 16.1.2, works great.
Thanks for this.
The hierarchy of the resolve class in the nested view is different from what I expected. From the python API docs I would expect the MediaPool object to be under the project class and so on.
Is this my lack of understanding of the objects hierarchy?
Offline
User avatar

roger.magnusson

  • Posts: 1356
  • Joined: Wed Sep 23, 2015 4:58 pm

Re: Script: Class Browser for DaVinci Resolve/Fusion

PostMon Feb 24, 2020 8:17 am

I don't know if BMD:s system for generating the help data has some manual parts in it (besides the text) or if it's entirely automatic. If it's automatic I would say it's correct.

However, just because you need a Project reference to get a MediaPool reference doesn't say anything about where they inherit from. They don't need to be related at all. Think of inheritance as "is a", as in "MediaPool is a Project". Then it should be clear that it's not correct.
Offline
User avatar

roger.magnusson

  • Posts: 1356
  • Joined: Wed Sep 23, 2015 4:58 pm

Re: Script: Class Browser for DaVinci Resolve/Fusion

PostTue Mar 31, 2020 3:14 am

While the script still works in Resolve, the latest Fusion Studio (v16.2 build 22) on macOS has an issue where any Lua script that is executed from the Script menu fails when running loops. Hopefully it will be fixed soon since this affects a ton of scripts made by the Fusion community.
Offline
User avatar

roger.magnusson

  • Posts: 1356
  • Joined: Wed Sep 23, 2015 4:58 pm

Re: Script: Class Browser for DaVinci Resolve/Fusion

PostThu Apr 02, 2020 10:13 pm

Class Browser 1.1 adds the ability to view registry attributes for Fusion classes. Download link is in the first post.
Offline
User avatar

Pieter Van Houte

  • Posts: 502
  • Joined: Wed Nov 05, 2014 1:04 am

Re: Script: Class Browser for DaVinci Resolve/Fusion

PostMon Apr 06, 2020 5:56 am

This looks very useful indeed! You should put this in Reactor... ;)
Offline
User avatar

roger.magnusson

  • Posts: 1356
  • Joined: Wed Sep 23, 2015 4:58 pm

Re: Script: Class Browser for DaVinci Resolve/Fusion

PostSun May 10, 2020 8:09 pm

I think the next version of the Class Browser might be worthy of a Reactor release. It's all about Fusion this time.

...and it's released today! :D
Link in the first post.

Anyone who has ever tried to make a Fuse script will appreciate this I think. The Class Browser can now discover methods that aren't listed in Fusion's built-in script help system.

Some notable Fuse-related classes to look at:
  • Operator (/Object/Operator)
    Here you will find methods like GetPrevKeyTime(t) which allows a Fuse easy access to relevant keyframe details.

  • Request (/Object/Message/Request)
    Ever needed to get the current tool inside the Fuse Process() method? GetOp() will take care of that.

  • InputControl and its sub classes (/Object/InputControl/*)
    The Tag Map (also known as TagList or Attributes) is listed for each input control. Tag Maps that use enum values have them listed here as well.

  • Image (/Object/Parameter/Image)
    95 methods that weren't visible before. :o
    Oh, and all the Tag Maps you can eat.
Offline
User avatar

Bryan Ray

  • Posts: 1468
  • Joined: Mon Nov 28, 2016 5:32 am
  • Location: Los Angeles, CA, USA

Re: Script: Class Browser for DaVinci Resolve/Fusion

PostMon May 11, 2020 3:46 pm

Fantastic! Thank you so much!
Bryan Ray
http://www.bryanray.name
http://www.musevfx.com
Offline
User avatar

robozb

  • Posts: 335
  • Joined: Wed Apr 17, 2019 6:48 am
  • Location: Hungary
  • Real Name: Roboz Bela Tamas

Re: Script: Class Browser for DaVinci Resolve/Fusion

PostSat Jul 18, 2020 10:25 am

Cooool!!! Thank you!!!
Offline
User avatar

TheBloke

  • Posts: 264
  • Joined: Sat Nov 02, 2019 11:49 pm
  • Real Name: Tom Jobbins

Re: Script: Class Browser for DaVinci Resolve/Fusion

PostSat Jul 18, 2020 10:58 am

This is fantastic! I've wanted to start getting into scripting and this is going to be an incredible help.

Lovely UI, too.

Please do put this in Reactor if/when you've got the time. It deserves to be seen by the biggest audience possible, and it'd be great to have automatic version management and the rest.

Thanks so much for this.
Resolve Studio 16.2.4.016 and Fusion Studio 16.2.4 on macOS Mojave 10.14.6

Hackintosh: X58, Intel X5670 @ 4.32 Ghz, 48GB RAM, AMD Vega 64 8GB
Monitors: 1 x 3840x2160 (4K) & 3 x 1920x1200
Audio: Behringer UMC404HD

Return to DaVinci Resolve

Who is online

Users browsing this forum: Bing [Bot], Google [Bot], HarrisonSawyer and 83 guests