Difference between revisions of "API"

From Light Forge Wiki
Jump to: navigation, search
(onEdit)
(Events)
Line 60: Line 60:
  
 
Usage:
 
Usage:
  def onInitialize():
+
<syntaxhighlight lang=python>
      print("Script Loaded")
+
def onInitialize():
 +
print("Script Loaded")
 +
</syntaxhighlight>
  
 
==onEdit==
 
==onEdit==
Line 76: Line 78:
  
 
Usage:
 
Usage:
  def onExecute():
+
<syntaxhighlight lang=python>
      print("Script Executed")
+
def onExecute():
 +
print("Script Executed")
 +
</syntaxhighlight>
  
 
==onExecuteAsync==
 
==onExecuteAsync==
Line 83: Line 87:
  
 
Usage:
 
Usage:
  def onExecuteAsync():
+
<syntaxhighlight lang=python>
      print("Script Executed Asynchronously")
+
def onExecuteAsync():
 +
print("Script Executed Asynchronously")
 +
</syntaxhighlight>
  
 
==onStartup==
 
==onStartup==
Line 90: Line 96:
  
 
Usage:
 
Usage:
  def onStartup():
+
<syntaxhighlight lang=python>
      print("Lightforge Started")
+
def onStartup():
 +
print("Lightforge Started")
 +
</syntaxhighlight>
  
 
==onStartupAsync==
 
==onStartupAsync==
Line 97: Line 105:
  
 
Usage:
 
Usage:
  def onStartupAsync():
+
<syntaxhighlight lang=python>
      print("Lightforge Started (Async)")
+
def onStartupAsync():
 +
print("Lightforge Started (Async)")
 +
</syntaxhighlight>
  
 
==onPlaybackStart==
 
==onPlaybackStart==
Line 104: Line 114:
  
 
Usage:
 
Usage:
  def onPlaybackStart():
+
<syntaxhighlight lang=python>
      print("Playback Started")
+
def onPlaybackStart():
 +
print("Playback Started")
 +
</syntaxhighlight>
  
 
==onPlaybackStop==
 
==onPlaybackStop==
 
Called when timeline playback has stopped
 
Called when timeline playback has stopped
  
Usage:  
+
Usage:
  def onPlaybackStop():
+
<syntaxhighlight lang=python>
      print("Playback Stopped")
+
def onPlaybackStop():
 +
print("Playback Stopped")
 +
</syntaxhighlight>
  
 
==onFrameChange==
 
==onFrameChange==
 
Called on every frame change during playback, scrubbing, and time changes.
 
Called on every frame change during playback, scrubbing, and time changes.
  
Usage:
+
Usage:
  def onFrameChange(seconds As Double):
+
<syntaxhighlight lang=python>
      print("Frame Changed " + seconds)
+
def onFrameChange(seconds As Double):
 +
print("Frame Changed " + seconds)
 +
</syntaxhighlight>
  
 
==onShutdown==
 
==onShutdown==
 
Called when Lightforge is shutting down.
 
Called when Lightforge is shutting down.
  
Usage:
+
Usage:
  def onShutdown():
+
<syntaxhighlight lang=python>
      print("Lightforge Shutdown")
+
def onShutdown():
 +
print("Lightforge Shutdown")
 +
</syntaxhighlight>
  
 
==onCuelistChanged==
 
==onCuelistChanged==
Line 132: Line 150:
  
 
Usage:
 
Usage:
  def onCuelistChanged():
+
<syntaxhighlight lang=python>
      print("Cue List Changed")
+
def onCuelistChanged():
 +
print("Cue List Changed")
 +
</syntaxhighlight>
  
 
==onShowLoaded==
 
==onShowLoaded==
Line 139: Line 159:
  
 
Usage:
 
Usage:
  def onShowLoaded():
+
<syntaxhighlight lang=python>
      print("Show Loaded")
+
def onShowLoaded():
 +
print("Show Loaded")
 +
</syntaxhighlight>

Revision as of 18:54, 9 May 2013

Contents

Types

api.attributeTypes

api.attributeTypes


Classes

api.cues

Used for working with cues.

api.cues

api.groups

Used for working with groups.

api.groups

api.output

Used for getting information about DMX output.

api.output

Functions

getTime

getTime() As Double

Gets the current playback position.

Usage:

print(api.getTime())

setTime

setTime(time As Double)

Sets the current playback position to the specified time.

Usage:

api.setTime(36.5)
print(api.getTime())

wait

wait(seconds As Double)

Causes execution to wait for the specified number of seconds.

Usage:

api.wait(3.5)

Events

onInitialize

Called when the script is loaded.

Usage:

def onInitialize():
	print("Script Loaded")

onEdit

Called when the script settings are being edited. Editing a script's settings from the Script Settings Dialog is only possible if this function is implemented in your code.

Usage:

def onEdit():
	print("Settings Edit")

onExecute

Called when this script is specifically executed.

Usage:

def onExecute():
	print("Script Executed")

onExecuteAsync

Called when this script is specifically executed. Code run from this function is executed asynchronously.

Usage:

def onExecuteAsync():
	print("Script Executed Asynchronously")

onStartup

Called when Lightforge starts up.

Usage:

def onStartup():
	print("Lightforge Started")

onStartupAsync

Called when Lightforge starts up. Code run from this function is executed asynchronously.

Usage:

def onStartupAsync():
	print("Lightforge Started (Async)")

onPlaybackStart

Called when timeline playback has started.

Usage:

def onPlaybackStart():
	print("Playback Started")

onPlaybackStop

Called when timeline playback has stopped

Usage:

def onPlaybackStop():
	print("Playback Stopped")

onFrameChange

Called on every frame change during playback, scrubbing, and time changes.

Usage:

def onFrameChange(seconds As Double):
	print("Frame Changed " + seconds)

onShutdown

Called when Lightforge is shutting down.

Usage:

 
def onShutdown():
	print("Lightforge Shutdown")

onCuelistChanged

Called when the current cuelist has been changed.

Usage:

def onCuelistChanged():
	print("Cue List Changed")

onShowLoaded

Called when a new show has been loaded.

Usage:

def onShowLoaded():
	print("Show Loaded")
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox