# Name: Speed Emitter # Description: Creates particles based on the speed of an object. # Author : Brandon Young # Date : September 12th 2008 # Version : 1.0s #--------------------------------------- #-------------------------------------------------- # Function: onSimulationBegin #-------------------------------------------------- def onSimulationBegin(): emitter = scene.getEmitter("Circle01") emitter.setParameter("Speed" ,0.0) #-------------------------------------------------- # Function: onSimulationStep #-------------------------------------------------- def onSimulationStep(): emitVel = .1 emitter = scene.getEmitter("Circle01") object = scene.getObject("Sphere01")# dont use a null object doesnt work. objVel = object.getVelocity().module() if objVel > emitVel: emitter.setParameter("Speed", 2.0*objVel) else: emitter.setParameter("Speed", 0.0) #-------------------------------------------------- # Function: onSimulationFrame #-------------------------------------------------- def onSimulationFrame(): pass #-------------------------------------------------- # Function: onSimulationEnd #-------------------------------------------------- def onSimulationEnd(): pass #-------------------------------------------------- # Function: onChangeToFrame #-------------------------------------------------- def onChangeToFrame(): pass