Vizard 7 » Command Index » Vizard modules » viztask » <viztask:Condition>.update
7.6

<viztask:Condition>.update

Update the condition

<viztask:Condition>.update()  

Remarks

Override this function to update the status of your custom Condition object.

When the condition has been met, this function should return True, otherwise it should return False

This function is generally called once per frame.

Return Value

True if the condition has been met, False otherwise

Example

import viztask

class waitTime(viztask.Condition):
    """Wait for specified number of seconds to elapse"""
    def __init__(self,seconds):
        self.__seconds = seconds

    def reset(self):
        self.__end = viz.getFrameTime() + self.__seconds
        
    def update(self):
        return self.__end <= viz.getFrameTime()