Particle Tracer

Add the script to Simulation Flow (Ctrl/Cmd + F2) > StepsPre.

The script traces a particle's path by adding new particles. When a given particle limit has been reached the source particles will be deleted and no more trace particle will be added.

This script can only be used in conjunction with standard particle emitters, because the required "freeze()" command is not available for Dyverso and Hybrido.

Scene Preparation

  • Create a standard particle emitter of your choice ("Square", "Circle", "Triangle", "Sphere", "Cylinder", etc.) as the particle source.
  • Add a "Container" node to store the tracer particles.
  • Important: Use exactly the same "Resolution" for both emitters.
  • Set the emitter's "Type" to "Dumb".
  • Decrease "MAX substeps" to 20 under → Simulation options > General.
  • For better results add a "Noise Field" daemon and set its "Strength" to values around 3.
  • Display the "Container" node's particles as spheres: Container01 > Node Params > Display type > Sphere, and change "Size" to 0.015.

 

# Stop adding new particles after particleLimit
# Get the standard particle emitter and a container - both must have the same "Resolution"
particleLimit  = 100000
sourceEmitter  = scene.get_PB_Emitter("Sphere01") # Change the name to the actual emitter's name, e.g. "Circle01" or "Bitmap01".
tracerEmitter  = scene.get_PB_Emitter("Container01")
nullVelocity   = Vector.new(0,0,0)

# Get the emitters' particles
sourceParticles = sourceEmitter.getParticles()
tracerParticles = tracerEmitter.getParticles()

# Check if the limit has been reached. If not, continue... 
if (len(tracerParticles) <= particleLimit):
 
	# Go through the source particles and a new particle at the current position, freeze the new particle
	for particle in sourceParticles:
		newParticle = tracerEmitter.addParticle(particle.getPosition(), particle.getVelocity())
		newParticle.freeze()

# Stop adding new particles by deleting the sources, simulation goes on though 
else:
	sourceEmitter.removeAllParticles()