WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 04-29-2005, 12:44 PM
cade_mccall cade_mccall is offline
Member
 
Join Date: Sep 2004
Posts: 61
waittime

Hey guys-

We're having trouble with using a waittime command within a director function. No matter where the waittime commands are within the sequence, the pause always occurs at the beginning of the sequence of events. Here's some example code:

def viewPic():
label.visible(viz.OFF)
viz.waittime(2)
quad.texture(pics[0])
quad.visible(viz.ON)

In this code, the label disappears after 2 seconds and then the quad immediately appears. What are we doing wrong?
Reply With Quote
  #2  
Old 04-29-2005, 02:34 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
Hi Cade,

Can you try the following code. I tried it here and it works fine. Also, make sure that you aren't changing the visiblity of the objects somewhere else in your code. Just press the spacebar. The label should disappear and a quad should show up 2 seconds later.
Code:
import viz
viz.go()

label = viz.add(viz.TEXT3D,'Label',viz.SCREEN)
label.translate(0.5,0.5)
label.alignment(viz.TEXT_CENTER_CENTER)

quad = viz.add(viz.TEXQUAD,viz.SCREEN)
quad.translate(0.5,0.2)
quad.visible(viz.OFF)

def viewPic():
	label.visible(viz.OFF)
	viz.waittime(2)
	#quad.texture(pics[0])
	quad.visible(viz.ON)

def onkeydown(key):
	if key == ' ':
		viz.director(viewPic)

viz.callback(viz.KEYDOWN_EVENT,onkeydown)
Reply With Quote
  #3  
Old 04-29-2005, 03:00 PM
cade_mccall cade_mccall is offline
Member
 
Join Date: Sep 2004
Posts: 61
Thanks Farshid. That script works so I put the texture command outside of the director thread in my original script and now it works as well. What was my problem there? Was it that I was tinkering with a 3D object within the director sequence?
Reply With Quote
  #4  
Old 04-29-2005, 03:06 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
I'm not sure what the problem is. I tried adding the texture command within the director function and it still works for me. Are any error messages being printed out?
Reply With Quote
  #5  
Old 04-29-2005, 03:39 PM
cade_mccall cade_mccall is offline
Member
 
Join Date: Sep 2004
Posts: 61
I figured out what I did wrong when the waittimes were all going off at the beginning of the sequence. When I called the director function I used an extra set of parentheses: viz.director(viewPic()).
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


All times are GMT -7. The time now is 02:55 AM.


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