WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Thread Tools Rate Thread Display Modes
Old 04-02-2011, 08:47 AM
Zhi Zhi is offline
Join Date: Mar 2011
Posts: 49
How to delay time in Vizard

Hi all,

I want to define a function which will be called when the mouse is clicked. The function will block the viz.MainView for a second. Here is my code:

import viz
import time
def BlockMainView():
vizact.onmousedown(viz.MOUSEBUTTON_LEFT, BlockMainView)

However, the delay function seems being executed before viz.visible(viz.OFF) and viz.visible(viz.ON), so that the viz.visible(viz.OFF) seems never being executed. How can I solve the problem?

Reply With Quote
Old 04-02-2011, 02:43 PM
Zhi Zhi is offline
Join Date: Mar 2011
Posts: 49
I have found a way around:

def myTask():
while True:
btn = yield viztask.waitMouseDown(None) #Wait for mouse click
viz.visible(viz.OFF) #Turn off the screen

if btn.button == 1: #Left botton click
yield function_a()
elif btn.button == 4: #Right botton click
yield function_b()

yield viztask.waitTime(1)
viz.visible(viz.ON) #Turn on the screen


Reply With Quote

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
Realistic Light and Shadows Using Vizard and 3DS Max jde Vizard 4 07-13-2012 11:58 AM
Vizard 4 Beta Testing farshizzo Announcements 0 02-01-2011 11:46 AM
Vizard 4 Beta Testing farshizzo Vizard 0 02-01-2011 11:46 AM
Vizard tech tip: Using the Python Imaging Library (PIL) Jeff Vizard 0 03-23-2009 12:13 PM
timer question Elittdogg Vizard 5 10-10-2007 03:49 PM

All times are GMT -7. The time now is 01:08 AM.

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