Speed Emission

Share your scripts with other members
User avatar
brandony
Posts: 231
Joined: Sat Oct 21, 2006 7:38 am

Speed Emission

Postby brandony » Sat Sep 13, 2008 12:34 am

Code: Select all

# 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
Brandon Young
www.byvfx.com
FX Artist | TD


shaun_michael
Posts: 4766
Joined: Sun Sep 10, 2006 8:04 am

Speed Emission

Postby shaun_michael » Sat Sep 13, 2008 11:14 am

Thanks for sharing Brandon.

Shaun

User avatar
brandony
Posts: 231
Joined: Sat Oct 21, 2006 7:38 am

Speed Emission

Postby brandony » Sun Sep 14, 2008 9:19 pm

yeah no problem! kinda useful if want to parent an emitter to and object and dont want to hand animate the speed.
Brandon Young
www.byvfx.com
FX Artist | TD


Return to “User Scripts”

Who is online

Users browsing this forum: No registered users and 1 guest