Breaking while loops with timers
Hello Vizard-Team!
I have a small problem: I want to break a while loop either with a button press (works fine) or after a certain amount of time has expired. So far, I have not been able to manage it with timer functions. Is there another way? The code below shows my current status. The timer function is called correctly and expires correctly after 10s, but the global testTrig variable is not parsed and the while loop does not break. Any thoughts? Thank you! Code:
def test(): |
Are you doing anything in your while loop other than waiting for time to pass or the waitJoyButton condition? If not, it seems you could replace the while loop with something like:
Code:
yield viztask.waitAny( [ waitJoyButton, viztask.waitTime(10) ] ) |
Works brilliantly and much more elegant than creating a time for it...
Thanks! :) |
All times are GMT -7. The time now is 02:54 AM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC