View Single Post
  #1  
Old 03-24-2009, 01:25 PM
durf durf is offline
Member
 
Join Date: Feb 2009
Posts: 61
.clone() or .copy()

Hello,

Im writing a program that adds a node3d and lets the node run for 3.5 seconds and then removes the node3d when its triggered by some speed. The node is also looping animation(IE it appears then disappears, then does it over and over again).

The problem Im having is its causing my program to slow down and get laggy. When i try .clone() it takes wherever the orginal node is in its loop and starts it from that point. When i try .copy() the node never starts its animation. The node appears but never loops.

I just want it to run faster.

This is the way I have the code right now. Its goes slow when I run this.
Code:
if obj.speed > 1 and obj.speed < 2.5:
     def showFlower():
	flower1 = viz.add('flower_grow_01.wrl')  #ADDS
	flower1.scale(.06,.06,.06)

	x,y,z = ball1.getPosition()
				
	if z < 0:
             	flower1.setPosition([x,0,-10])
	if z >= 0:
		flower1.setPosition([x,0,10])
				
	a,b,c = int1.getEuler()  #add
	flower1.setEuler(a,0,0)  #add
				
	yield viztask.waitTime( 3.5 )
	flower1.remove()                      #REMOVES 
				
viztask.schedule( showFlower() )
Any help is much appreciated.

Thanks
Reply With Quote