Vizard 7 » Command Index » Vizard modules » viztask » <viztask>.waitCall
7.3

<viztask>.waitCall

Wait for a function call with mix parameters to complete

<viztask>.waitCall(  
func  
*args  
**kw  
)  
func
A function or callable object to call
*args
Arguments to pass to the function
**kw
Keyword arguments to pass to the function

Remarks

This command will create a Condition object that will call the specified function every frame until all mix parameters complete. This is useful for animating arbitrary commands (e.g. field of view, media volume, shader uniforms, etc...).

Return Value

viztask.Condition object

Example

import viz
import viztask
viz.go()

viz.add('dojo.osgb')

def ZoomTask():

    viz.fov(60)

    zoom_in = vizact.mix(60, 20, time=0.5, interpolate=vizact.easeOutStrong)
    zoom_out = vizact.mix(20, 60, time=0.5, interpolate=vizact.easeOutStrong)

    while True:

        yield viztask.waitKeyDown(' ')

        yield viztask.waitCall(viz.fov,zoom_in)

        yield viztask.waitKeyDown(' ')

        yield viztask.waitCall(viz.fov,zoom_out)


viztask.schedule( ZoomTask() )

See also

<vizact>.mix
<vizact>.call
<vizact>.method.[name]