Eyeon:Script/Reference/Applications/Fusion/Composition Scripts

From VFXPedia

< Eyeon:Script | Reference | Applications | Fusion
Revision as of 14:01, 9 December 2006 by Peter (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Introduction

A composition script is any .eyeonscript file found within the Scripts/Composition directory. Composition Scripts are scripts that start within the context of the current composition. This means that a script starts with variables pre-initialized to point to the composition and Fusion objects for the current instance of Fusion.

fusion

  • A variable pointing to the current instance of Fusion.

Exactly like typing

fusion = Fusion().

composition

  • A variable pointing to the current active composition.

Exactly like typing:

composition = fusion:GetCurrentComp().

Essentially composition scripts run as if the following three commands had been entered before the script ran :


fusion = Fusion("localhost") composition = fusion:GetCurrentComp() SetActiveComp(composition)


Composition scripts are generally used as scripts that affect all tools in the composition, launch renders, and perform other global operations on Fusion and the current composition.

Running composition Scripts

Composition scripts can be run by selecting the desired script name from the 'Scripts' menu at the top of the interface. This menu is dynamically built by scanning the Scripts/Composition directory for .eyeonscript files each time the menu is opened. This means that you do not have to close or restart Fusion after adding a new script to the composition directory.

Installing composition Scripts

To install a new Composition script copy it into the Fusion\Scripts\Composition 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 Scripts directory.

Editing Composition Scripts

The Scripts menu has a submenu labeled edit, which also displays a list of all the Composition scripts currently available. Selecting a script from this submenu will open the script for editing in the Text Editor of your choice. The text editor used is configured in the scripting panel of the global preferences. By default this is set to Notepad.exe when Fusion is first installed.

If you plan to develop or edit your own scripts, a more powerful text editor than notepad.exe may be appropriate. You can change the path to the script editor in your global scripting preferences to point to the SciTe editor installed with Fusioninstead.


Tips for Composition Scripts (edit)

  • If you want to write a script that works as a comp and as a tool script, you can find out the currently active tool (which is the contents of the tool variable that's available to tool scripts) like this:
tool = tool or composition.ActiveTool