pixelstuff wrote: ↑
Fri Dec 21, 2018 1:37 pm
I have seen some code for getting the mouse x and y but nothing for sampling whats under the cursor, if that's possible with script?
That question has multiple answers.
Selection/Context Aware UI Manager Actions
Blackmagic Design has refused to publish any useful or detailed official documentation guides on the "UI Manager" API during the full Fusion 8.2.1, Fusion 9, and Resolve 15 release cycles that had UI Manager present in them. Nothing. Nada. Zip.
In fact for LOLz if you look at the Fusion 9 bundled developer documentation of the "Fusion 8 Script Manual.pdf" file, when you browse to the "Events and Callbacks" section on page 25 they list functionality that has never existed in Fusion 8 or 9!
Those features were ripped out after the Fusion 7.x era but BMD's technical writer team was "asleep at the switch" and spending all their time putting typographer's quotes into the code snippets in the PDF to look fancy but make code that could never run.
By Fusion 8 and 9 all the events and callbacks are actually done using .fu or .zfu files with Actions and Events entries.
These .fu files need to placed into one of your
PathMap folders to work. AFAIK you won't see any documentation on how to make a .zfu file either from any of BMD's official PDF guides...
TBH it's just not something the Resolve/Fusion product management staff prioritize, care about, or value. That's likely since software pipeline automation and supporting TD's... doesn't directly sell truckloads of BMD ATEM switches or Resolve control panels which appear to be what matters these days.
The reason I am mentioning Actions and Events as being important in Fusion is that your custom GUI is capable of being context sensitive and responding to the active node selection that updates in real-time during the artist session in Fusion.
If you look at the following UI Manager Lua examples in Reactor you will see code examples and details that you could use to make it so your script's gui could refresh and list the inputs and outputs that exist on the selected node in a "ComboControl".
- Scripts:/Comp/List Input Control Names.lua
- Scripts:/Comp/List Output Control Names.lua
- Scripts:/Comp/Action Listener.lua
- Scripts:/Comp/Action Printout.lua
- Config:/UI Manager/Selected Node Count HUD.fu.zip
- Config:/UI Manager/FusionCompEvents.fu.zip
Not everything you would think of doing as a "script" needs to be done in Lua/Python from a Tools or Comp script.
You can make a lot of custom tools in Fusion as macros and fuses and they will let you use expression linking, and a native color picker control on the macro node. You can also embed Lua scripts into the ButtonControls's "BTNCS_Execute" attribute in your macro node. And you can even pack UI Manager GUI's into a button
on macro node too!
The Cryptomatte.fuse Locator Control
The Cryptomatte Fuse
has a color picker that was implemented as a locator like "cursor" on the node. That position can then be used inside of the fuse to read data at a specific image coordinate.
Macros and Expressions
VFXPedia Macro Tips
VFXPedia Gringo - User Controls - Color Control
Any expression field can hold a raw Lua code snippet by starting the line of the expression with a colon like
. Just make sure to return a value from the expression if you do the Lua code thing that way.
Learning how to discover and use Fusion/Resolve's Undocumented API Features
Technically, you could spend part of an afternoon and use Reactor to install the "Scripts/Comp/UI Manager Lua & Python Examples" atom package to answer your questions at a very very deep level. Anything that could *ever* be done in a fuse, macro, or script in the copy of Fusion sitting on your computer could *theoretically* be probed using the following tools:
You would start by running the "FusionScript Help Browser" script to peek inside Fusion and see what members and classes exist under the hood.
Then the "Action Listener" script can show you callbacks that are triggered when you interact inside of the Fusion UI with anything that was coded using the modern "Actions" system that can be listened too.
The "Fusion Global Variable Viewer" tool lets you browse through a memory dump of all global variables inside of Fusion. This can reveal types of UI controls on that have never been revealed by Eyeon or BMD for macros, fuses, and UI controls. It is technically a view of everything.
And finally, you could use the "Fusion Registry Scanner" tool as well.
Those tools don't tell you the code to use. But they give you a good idea of the base functions and features that are possible.
Good Luck! I had a lot of fun exploring UI Manager in 2017 and 2018. I hope you get the same amount of joy seeing what is possible in 2019 when you customize your working environment and truly personalize your Fusion workflows. IMO it can be enormously satisfying and rewarding to make a tool work just how you like it.
You do not have the required permissions to view the files attached to this post.