Eyeon:Script/Reference/Applications/Fusion/Classes/Composition/Lock

From VFXPedia

< Eyeon:Script | Reference | Applications | Fusion | Classes | Composition
Revision as of 04:10, 5 December 2008 by Daniel (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Contents

Composition : Lock()

Arguments

Lock()

Returns

This function does not return a value.

Remarks

The Lock() function sets a composition to non-interactive ("batch", or locked) mode. This makes Fusion suppress any dialog boxes which may appear, and additionally prevents any re-rendering in response to changes to the controls. A locked composition can be unlocked with the Unlock() function, which returns the composition to interactive mode.

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

Unlock()


Tips for Lock (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.