Vizard 7 » Command Index » Vizard modules » vizact » <vizact>.sendsignal
7.6

<vizact>.sendsignal

Create an action that will trigger a signal object

<vizact>.sendsignal(  
signal  
num = 0  
)  
signal
The signal object to trigger
num = 0
The maximum number of objects to trigger. If the value is less than or equal to 0 then all objects waiting on the signal will be triggered.

Remarks

After you have created the action you can add it to any object as many times as you want. This action will trigger the specified number of actions that are currently waiting on the signal.

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

An action that can be applied to any object

Example

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

#Create an action to wait on the signal
waitsig = vizact.waitsignal(sig)

#Create an action to trigger the signal
trigsig = vizact.sendsignal(sig)

#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(trigsig)

object1.addAction(waitsig)
object1.addAction(fadeout)

object2.addAction(waitsig)
object2.addAction(fadeout)

object3.addAction(waitsig)
object3.addAction(fadeout)

See also

<vizact>.signal
<vizact>.waitsignal
<vizact>.fadeTo
<vizact>.moveTo