![]() |
#1
|
|||
|
|||
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? |
#2
|
|||
|
|||
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) |
#3
|
|||
|
|||
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?
|
#4
|
|||
|
|||
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?
|
#5
|
|||
|
|||
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()).
|
![]() |
Thread Tools | |
Display Modes | Rate This Thread |
|
|