# Name : Bubble Script # Description: Create tearing effect off a main bubble. # # Author : Brandon Young # Date : August 30th 2008 # Version : 1.0 #-------------------------------------------------- #-------------------------------------------------- # Function: onSimulationStep #-------------------------------------------------- def onSimulationStep(): bubble = scene.getEmitter("Sphere01") trails = scene.getEmitter("Circle01") particles = bubble.getParticles() #vel = Vector.new(0,0,-14) for particle in particles: neighbors = particle.getNeighbors( .066) if (len(neighbors)>0): for neighbor in neighbors: pos = neighbor.getPosition() vel = neighbor.getVelocity() trails.addParticle(pos, vel) bubble.removeParticle(particle.getId()) #-------------------------------------------------- # Function: onSimulationFrame #-------------------------------------------------- def onSimulationFrame(): pass #-------------------------------------------------- # Function: onSimulationBegin #-------------------------------------------------- def onSimulationBegin(): pass #-------------------------------------------------- # Function: onSimulationEnd #-------------------------------------------------- def onSimulationEnd(): pass #-------------------------------------------------- # Function: onChangeToFrame #-------------------------------------------------- def onChangeToFrame(): pass