WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #26  
Old 03-01-2006, 01:16 PM
betancourtb82 betancourtb82 is offline
Member
 
Join Date: Jan 2006
Posts: 103
The code to remove is here:

Code:
def onmousedown(button):
	global index
	if button == viz.MOUSEBUTTON_LEFT:
		node = viz.pick() #Get object that was clicked
		if node in avatars: #Check if object is one of the avatars
			node.clear(viz.ALL)
			node.clear(viz.CURRENT_ACTION)
			node.execute(7) #Execute the "shot" animation
			#Create action to wait for the animation duration then freeeze the avatar
			WaitThenFreeze = vizact.sequence( vizact.waittime(node.getduration(7)-.14), vizact.speed_node(0))
			#vizact.sequence(vizact.waittime(2),avatars.remove(male),1)			
			node.add(WaitThenFreeze) #Add the action to the avatar
			node.clear(viz.ALL)
			node.clear(viz.CURRENT_ACTION)
			node.add(vizact.waittime(1))
			node.add(vizact.call(node.remove))
		index = index - 1
		if index == 0 :
				print 'new index is',index
				for i in range(NUM_AVATARS):
					newX = -math.cos(-2*i+15) * 2
					newZ = math.sin(i^2+1) * 2	
					male = viz.add('male.cfg')
					#male.face(facepic)
					male.translate(newX,-10,newZ)
					male.rotate(90,-10,0)
					#we might be able to use this type of declaration when we need to decide who is safe to shoot and who isn't
					male.SafeIndicator = 1						
					avatars.append(male) #Save avatar in list
					print "avatar indicator is", male.SafeIndicator	
viz.callback(viz.MOUSEDOWN_EVENT,onmousedown)
Reply With Quote
 


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 11:42 AM.


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