View Single Post
  #1  
Old 11-11-2010, 02:40 AM
Rinya Rinya is offline
Member
 
Join Date: Nov 2010
Posts: 2
Trouble with viz.ontimer

I've tried making a method that changes the textures on a different walls in a store. The walls are all different textures and can be changed by adjusting the slider in the GUI which calls this method:


Code:
def setLight(light):
    FRAME_RATE = 0.1
    disco = vizact.ontimer(1.0*FRAME_RATE, NextMovieFrame)
    
    if light == 0:
        disco.setEnabled(viz.OFF)
        #Dark light
        darkWall()
    elif light == 1:
        disco.setEnabled(viz.OFF)
        #Normal light
        originalSettings()    
    elif light == 2:
        disco.setEnabled(viz.OFF)
        #Faint light
        lightWall()
    elif light == 3:
        #Disco light
        disco.setEnabled(viz.ON)

The problem is that the viz.ontimer (named disco in this case) doesn't turn off. I even tried using values 0 and 1 instead of viz.ON and viz.OFF, however the 'discolights' still can't be turned off.

I've looked up other threads and tried adding booleans, but still this doesn't work. Does anyone have an idea?
Reply With Quote