Eyeon:Script/Reference/Applications/Fusion/Tool Scripts
From VFXPedia
Contents |
Introduction
A tool script is any .eyeonscript file found within the Scripts/Tools directory. Tool scripts are scripts that start within the context of the current Tool. This means that the script starts with variables pre-initialized to point to the Composition, Fusion and Tool objects.
An example of a tool script would be one that creates a new composition that sets up the proxy generation for the source of a given loader, and then puts that composition’s output into the proxy filename area for that loader.
- fusion, fu
A variable pointing to the current instance of Fusion. Exactly like typing:
fusion = Fusion()
- composition, comp
A variable pointing to the current active Composition. Exactly like typing:
composition = fusion:GetCurrentComp()
- tool
A variable pointing to the active tool.
Running Tool Scripts
Tool scripts can be run by right clicking on a tool and selecting the script to run from the context menu. This scripts sub-menu is dynamically built by scanning the Fusion\Scripts\Tool directory for .eyeonscript files each time the menu is opened. You do not need to close or restart Fusion after adding a new script to the Tools directory or modifying an existing one.
Installing Tool Scripts
To install a new tool script copy it into the Fusion\Scripts\Tool directory. The path to this directory is defined within the global paths preferences, by default it is a subdirectory of the main Fusion application directory. Any file with the .eyeonscript extension in this folder is automatically available from the Tool context menus.
Editing Tool Scripts
The Scripts menu has an additional submenu labeled Edit. Selecting a script from this sub-menu will open the script for editing in the Text Editor of your choice. The text editor used is configured in the global scripting preferences.
The default script editor is Windows Notepad, though you can change this to the SciTe text editor installed with Fusion if you prefer.