WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   Delay without viz.waittime? (https://forum.worldviz.com/showthread.php?t=310)

Johannes 03-15-2005 09:40 AM

Delay without viz.waittime?
 
Hi,
how do I put a delay inside my skript?
without viz.waittime which stalls the whole scene.

I want a projector screen to move down bevor graphs get put on it.

If I do:

screenWall.goto(0,-2.2,0, .8)
putGraphOnScreenWall()

the graphs are on the ScreenWall before it is down...

Thank you,
Johannes

farshizzo 03-15-2005 11:11 AM

You will need to use a callback for this. The following callback is called every time a built-in animation finishes. Check when the screen has finished moving then call your function:
Code:

def onactionend(object,action,pool):
        if object == screenWall and action == viz.MOVE:
                putGraphOnScreenWall()
               
viz.callback(viz.ACTION_END_EVENT,onactionend)


Johannes 03-16-2005 08:59 AM

Thank you.
It works 90 % fine.
When the user klicks on the graphOnWall Checkbox again, before the projection-surface is completely up, the graphs get put in the air.

I guess that is because while the projection-Surface is moved up and the user clicks the checkbox the movement is stopped => ACTION_END_EVENT is triggered, checkbox is ON and so the graphs get put in the air.

To solve this I would need to check, if the ACTION_END_EVENT occured after the surface moved down vs. up.

Sorry, solved it while writing this:
if checkboxWall.get()==1 and screenWall.get(viz.POSITION)[1]==0:


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

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