Vizard 8 » Command Index » Vizard modules » vizact » <vizact>.signal
8.0

<vizact>.signal

Create a signal object

<vizact>.signal()  

Remarks

A signal object is used when you want to synchronize multiple actions. You can create an action that waits on a signal object. You can then create an action that triggers a signal object. This way, multiple actions can be waiting on the same signal and they will all be activated simultaneously once the signal is triggered.

As a shortcut, the signal object already contains the actions to wait and trigger, <signal>.wait and <signal>.trigger. You can directly add these to an object instead of creating the actions using <vizact>.waitsignal and <vizact>.sendsignal.

Return Value

Signal object

Example

#Create the signal object
sig = vizact.signal()

#Create an action to fade an object out
fadeout = vizact.fadeTo(0,time=1)

#Create an action to go to [10,0,0]
moveto = vizact.moveTo([10,0,0],speed=1)

#Add the actions to the objects.
#When 'object' is done moving it will trigger the signal.
#This will cause all the objects waiting on the signal to start fading out.

object.addAction(moveto)
object.addAction(sig.trigger)

object1.addAction(sig.wait)
object1.addAction(fadeout)

object2.addAction(sig.wait)
object2.addAction(fadeout)

object3.addAction(sig.wait)
object3.addAction(fadeout)

See also

<vizact>.sendsignal
<vizact>.waitsignal
<vizact>.fadeTo
<vizact>.moveTo