WorldViz User Forum

WorldViz User Forum (
-   Vizard (
-   -   stopping a function (

durf 03-31-2009 09:50 AM

stopping a function

I have def func1() and def func2() that do not run on timers of there own. I have a def maintask() that controls when each of the def() will start. The problem I am having is once func1() time has expired and func2() timer starts func1() keeps runnning.

def MainTask():
        #Run func1 for 10 seconds
        timer = vizact.ontimer2(0,0,func1)
        yield viztask.waitTime(10)
        #Run func2 for 10 seconds
        timer = vizact.ontimer2(0,0,func2)
        yield viztask.waitTime(10)

        #Quit script
        timer = vizact.ontimer2(0,0,func3)
        yield viztask.waitTime(viz.FOREVER)
viztask.schedule( MainTask() )

how do I stop func1() from running once func2() has started?

I can supply more code if need be. Just looking for an example

masaki 03-31-2009 04:45 PM

in order to kill a vizact timer, use the following code:

if you want to kill a viztask function use the following code:

task = viztask.schedule( sometask() )


All times are GMT -7. The time now is 02:21 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2021, vBulletin Solutions, Inc.
Copyright 2002-2018 WorldViz LLC