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

<viztask>.waitTrue

Wait for the specified function to return True

<viztask>.waitTrue(  
func  
*args  
**kw  
)  
func
A function or callable object that will return a value.
*args
Optional arguments to pass to the function
**kw
Optional keyword arguments to pass to the function

Remarks

This command will create a Condition object that will wait for the specified function to return a value that evaluates to True.

Return Value

viztask.Condition object

Example

import viztask

def WaitTrueTask():

    # Wait for main view to go above 5 meters
    yield viztask.waitTrue( lambda: viz.MainView.getPosition()[1] > 5.0 )

    print('Done waiting')

viztask.schedule( WaitTrueTask() )

See also

<viztask>.waitAll
<viztask>.waitAny