Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Use different colors for domains' particles to see the separation, or apply different daemons to the individual domains.

Code Block
languagepy
# Get the domains "DY_Domain01" and its particles, as well as "DY_Domain02"
domainA   = scene.get_DY_Domain("DY_Domain01")
domainB   = scene.get_DY_Domain("DY_Domain02")
particles = domainA.getParticles()
 

# Loop through every particle and check it is colliding with an objects.
# If the particle is colliding it is shifted to "DY_Domain02" and removed at its original position
for particle in particles:
	if (particle.isColliding() == True):
	domainB.addParticle(particle.getPosition(), particle.getVelocity())
	domainA.removeParticle(particle.getId())