Welcome to WSL!

Make yourself at home, but before posting, please may I ask you to read the following topics.


Posting 101
Server space, screenshots, and you

Thank you!

PS. please pretty please:


Image

Adding user defined Views to Hotkey file.

Moderator: SecondMan

User avatar
MelbFilm
Fusioneer
Posts: 90
Joined: Thu Oct 13, 2016 2:38 pm
Been thanked: 6 times

Adding user defined Views to Hotkey file.

#1

Post by MelbFilm » Sun Aug 20, 2017 4:30 pm

I was looking for a solution to this problem but couldn't find anything so I created a little function (Action) inside my hotkey file that some may find useful. The Action allows me to attach a hotkey to a viewer and tool combination so the viewer will display that tool on the specified viewer (number as seen in the 'view on' flow pop up). I often find myself switching between the plate and the final output for example and usually name my BG plate Loader as 'LdrInput' and my master saver as 'SvrOutput'. I can also name a tool 'View' and then that allows me to view it using Shift+W.

So I add the line to my hotkey.fu file (Target = "FuView"):

SHIFT_Z = "SetViewerTool{viewNum = 1 , toolName = 'LdrInput'}",

Where 1 = Left viewer and the tool is named 'LdrInput'.


Note: Written for Fusion 9 on Windows.
  1. {
  2.     Action
  3.     {
  4.         ID = "SetViewerTool",
  5.         Category = "MyStuff",
  6.         ShortName = "SVT",
  7.  
  8.         Args =
  9.         {  
  10.             { "viewNum", Type = "integer", Required = true },
  11.             { "toolName", Type = "string", Required = true },
  12.         },
  13.  
  14.         Targets =
  15.         {
  16.             Composition =
  17.             {
  18.                 Execute = [[
  19.                     -- Get the Tool
  20.                     t = obj:Comp():FindTool(args.toolName)
  21.                     if t == nil then
  22.                         print("Cannot find tool " .. args.toolName)
  23.                         return
  24.                     end
  25.                    
  26.                     -- Set the Frame
  27.                     fr = obj:Comp().CurrentFrame
  28.                     if fr == nil then
  29.                         print("No Frame")
  30.                         return
  31.                     end
  32.                     fr:ViewOn(t , args.viewNum)
  33.                 ]],
  34.             },
  35.         },
  36.     },
  37.  
  38.     Hotkeys {
  39.         Target = "FuView",
  40.        
  41.         SHIFT_Z = "SetViewerTool{viewNum = 1 , toolName = 'LdrInput'}",
  42.         SHIFT_X = "SetViewerTool{viewNum = 1 , toolName = 'SvrOutput'}",
  43.         SHIFT_W = "SetViewerTool{viewNum = 1 , toolName = 'View'}",
  44.     },
  45.    
  46. }