EyeonTips:Script/General Concepts/Script Libraries and Event Scripting

From VFXPedia

< EyeonTips:Script
Revision as of 09:35, 16 March 2013 by Tilt (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Composition Scriptlibs

As mentioned in the beginning, a .scriptlib file in your main Scripts: directory will be executed every time Fusion is started and when a comp is opened. In addition to this, you can also place a .scriptlib file in your Scripts:\Comp folder (where comp scripts are located). In this case, the scriptlib will only be executed every time a comp is opened (or a new one is created). (thanks to Isaac for mentioning this on the mailing list)

If you want a scriptlib to run only once when Fusion is started, you can check for the presence of the composition variable that's available to comp and tool scripts as well:

if composition == nil then
    -- no comp: Fusion is being started
else
    -- a comp is present
end