< Previous | Contents | Next >
Script Libraries
A scriptlib is a file containing a library of functions that can be used in multiple scripts. Included with the default installation of Fusion is the bmd.scriptlib, which contains common useful functions. The scriptlib could have additions in it such as variable declarations (added to the globals table, for instance). Script Libraries are installed in the root of the scripts directory (by default Scripts: ). In that directory, anything with a .scriptlib extension will be run whenever Fusion is started. In order to execute a scriptlib when a composition is created or opened, put the scriptlib in the Scripts:/ Comp folder instead. The added benefit of the scriptlib is that you can instruct Fusion to run a set of code every time a composition is created or opened. The downside to this is that Fusion will execute the files in the scripts directory in an arbitrary order. This means that any code you write in the script libraries that is reliant upon other libraries may not work. To get around this, try inserting the functions that are needed at the top of the scriptlib.
Beyond passing functions into the global environment of the composition, the scriptlib also can be set up to perform default actions on a composition. It can also be used to create custom events set up in event suites.