WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Vizact onupdate events that wont be disabled (https://forum.worldviz.com/showthread.php?t=3984)

Reca 11-03-2011 05:35 PM

Vizact onupdate events that wont be disabled
 
Hey

So my problem is that once i have registered 2 separate onupdate events i cant disable them or remove them.

this is where how i create them:

self.update = vizact.onupdate(viz.PRIORITY_PHYSICS-1, self.UpdateJoystick,viz.getFrameElapsed())
self.postupdate = vizact.onupdate(viz.PRIORITY_PHYSICS+1, self.PostPhysics)

then for disabling and re-enabling them.
def Pause(self):
#vizact.removeEvent( self.update )
#vizact.removeEvent( self.postupdate )
self.update.setEnabled(viz.OFF)
self.postupdate.setEnabled(viz.OFF)
pass

def Resume(self):
#self.update = vizact.onupdate(viz.PRIORITY_PHYSICS-1, self.UpdateJoystick,viz.getFrameElapsed())
#self.postupdate = vizact.onupdate(viz.PRIORITY_PHYSICS+1, self.PostPhysics)
self.update.setEnabled(viz.ON)
self.postupdate.setEnabled(viz.ON)
pass

i have tried to remove them, then re adding them, i have tried to use vizact.removeevent, but that didn't work either, but in the resume function when i recreated them it would double them up, as they werent being removed :(

the pause and resume functions are called by a joypad button press

thanks in for any help you can provide

Jeff 11-16-2011 05:25 PM

You can use .setEnabled to enable/disable the callback:
Code:

event_handle = vizact.onkeydown(' ',myFunction)
event_handle.setEnabled(viz.OFF)



All times are GMT -7. The time now is 01:07 PM.

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