Eyeon:Script/Reference/Applications/Fusion/Classes/Composition/Unlock
From VFXPedia
Contents |
Composition : Unlock
Arguments
Unlock()
Returns
This function does not return a value
Remarks
The Unlock() function returns a composition to interactive mode. This allows Fusion to show dialog boxes to the user, and allows re-rendering in response to changes to the controls. Calling Unlock() will have no effect unless the composition has been locked with the Lock() function first.
It is often useful to surround a script with Lock() and Unlock(), especially when adding tools or modifying a composition. Doing this ensures Fusion won't pop up a dialog to ask for user input, e.g. when adding a Loader, and can also speed up the operation of the script since no time will be spent rendering until the comp is unlocked.
Requirements
- eyeonScript 5.0
- Fusion 5.0
Examples
-- connect to a Fusion on a remote machine fusion = Fusion("192.168.0.50") -- create a new composition on the remote system composition = fusion:OpenComp("C:\\Fusion\\Comps\\sample.comp", false) -- set the composition as active SetActiveComp(composition) -- we don't want any dialogs appearing on the remote machine while we do this, -- so we lock the composition while we work. composition:Lock() -- copy the keyframes from Glow1.Glow to BrightnessContrast1.Contrast kf = Glow1.Glow:GetKeyFrames() for i = 1, table.getn(kf) do local time = kf[i] BrightnessContrast1.Contrast[time] = Glow1.Glow[time] end -- don't forget to unlock the composition, or it won't render composition:Unlock()
See Also
Tips for Unlock (edit)
Unlock() will clear the comp's caches, so don't just lock the comp for minor tasks. If you want to prevent the file browser from popping up when you create a Loader or Saver tool, you can temporarily modify the AutoClipBrowse settings as described on the snippets page.