WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 06-04-2009, 07:16 AM
durf durf is offline
Member
 
Join Date: Feb 2009
Posts: 61
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)
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 10:40 AM.


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