WorldViz User Forum

WorldViz User Forum (https://forum.worldviz.com/index.php)
-   Vizard (https://forum.worldviz.com/forumdisplay.php?f=17)
-   -   removing and obj with a timer (https://forum.worldviz.com/showthread.php?t=2071)

durf 06-04-2009 07:16 AM

removing and obj with a timer
 
Hello,
Is there a way to delete an object after it runs through a vizact.sequence()? Keeping in mind that there is a timer. This chunk of code below creates an object constantly and then does some actions then goes to a position that is not visible by the screen. after it reaches that position I want the object to be removed. I believe that this will speed up my program and decrease some lag. The problem is I dont know how to remove it properly after it does the runAction. Any ideas?


Code:


def scene12():

        ballLink1.enable()
        ballLink2.enable()
        ballLink3.disable()
        ballLink4.disable()
       
        viz.MainView.setPosition([0,8,-35]) #sets camera position
        viz.MainView.setEuler([0,-1,0]) #sets camera pitch
       
        rand_colors = [0,1,2,3,4]
        random.shuffle(rand_colors)
       
        rand_numbers = [0,1,2,3,4,5]
        random.shuffle(rand_numbers)
       
        rand_num = [0,1,2,3]
        random.shuffle(rand_num)
       
        x,y,z = ball1.getPosition()                               
        object = (colors[rand_colors[0]].copy())
        object.scale(.5,.5,.5)
       
        a,b,c = int1.getEuler() 
        object.setEuler(a,0,0)
                       
        object.setPosition([x,y-10,z])
        object.alpha(0)
        goTo1 = vizact.sequence(vizact.goto(x,y+8,z,1500),vizact.fadeTo(op[rand_num[0]],time=.7),vizact.waittime(5),vizact.goto(x,50,z,time=7))
        object.runAction(goTo1)       
       
timer12 = vizact.ontimer2(0,viz.FOREVER,scene12)
timer12.setEnabled(viz.OFF)



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

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