WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 11-03-2011, 05:35 PM
Reca Reca is offline
Member
 
Join Date: Oct 2011
Posts: 1
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
Reply With Quote
  #2  
Old 11-16-2011, 05:25 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,462
You can use <EventFunction>.setEnabled to enable/disable the callback:
Code:
event_handle = vizact.onkeydown(' ',myFunction)
event_handle.setEnabled(viz.OFF)
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with server Events vOliver Vizard 2 09-15-2010 02:21 PM
how to remove velocity when mouse is disabled? jvacare1 Vizard 2 02-18-2010 10:25 AM


All times are GMT -7. The time now is 07:27 AM.


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