PDA

View Full Version : Trouble with viz.ontimer


Rinya
11-11-2010, 02:40 AM
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:


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?

Rinya
11-11-2010, 02:59 AM
Resolved..
Apparently - the slider only went from 0-1-2 and back (but not to 3).