#1
|
|||
|
|||
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) |
|
|