Vizard 7 » Command Index » Vizard modules » viztask » <viztask>.addAction
7.6

<viztask>.addAction

Add an action to an object and wait for it to end

<viztask>.addAction(  
node  
action  
pool = 0  
)  
node
The node to apply the action to
action
The action to add to the node and wait for
pool = 0
The pool to add the action under

Remarks

This command will create a sub-task that adds an action to an object and waits for the action to end.

Return Value

A generator object which can be yielded

Example

import viztask

myball = viz.add('ball.wrl')

def MyTask():

    while True:

        yield viztask.addAction(myball,vizact.move(0,0,4,0.5))

        print('My ball finished moving')

        yield viztask.waitTime(1)

viztask.schedule( MyTask() )