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:
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.
Class Browser in Flat View mode
Nested View, with a filter applied to show all classes starting with "UI"
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.
To add the script to the Workspace > Scripts menu, place the script in this folder:
Any feedback is welcome!
Release notes
v1.3 2022-02-23
v1.2.3 2021-03-18
v1.2.2 2020-05-14
v1.2.1 2020-05-13
v1.2 2020-05-10
v1.1 2020-04-02
v1.0 2020-02-23
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
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.
Class Browser in Flat View mode
Nested View, with a filter applied to show all classes starting with "UI"
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.
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
Any feedback is welcome!
Release notes
v1.3 2022-02-23
- New: The "See also" references are now links where possible (not clickable in Fusion 9)
- New: The class name and inheritance hierarchy is now shown in a sticky header above the scrollable text area
- New: Added links to matching Qt documentation (according to my best guesses) when displaying the UI classes
- New: Option to enable verbose log for debugging
- New: Option to always rebuild the cached data file on start (set force_update_file = true)
- New: Support for manually added classes and class members (currently, methods are added to the Fairlight, Timeline and Timeline item classes in DaVinci Resolve)
- New: Open Script Folder button, for easy access to the code when the script has been installed
- New: Hover on a method return type to see if it has been given a descriptive name
- Fixed: Tag Maps didn't work in v17+ because the table structure had changed
- Fixed: UI issues after Qt was updated to 5.15.2
v1.2.3 2021-03-18
- Fixed: Startup crash in Resolve/Fusion v17.1 caused by class types that are no longer available
- Fixed: Classes containing only ignored discovered methods (like _cast) caused properties to be skipped
- Fixed: FuPath methods weren't being discovered
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.3.zip
- (22.81 KiB) Downloaded 494 times
Last edited by roger.magnusson on Wed Feb 23, 2022 7:54 pm, edited 8 times in total.