/
Shifting and Deleting Particles
Shifting and Deleting Particles
Add the script to Simulation Flow (Ctrl/Cmd + F2) > FramesPost or StepsPost.
The script copies Dyverso particles from "DY_Doman01" to "DY_Domain02" when they are colliding with an object. In order to avoid instabilities, the original particles will be deleted. Both domains must have exactly the same "Resolution" and "Type" settings.
Use different colors for domains' particles to see the separation, or apply different daemons to the individual domains.
# 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())
Related content
Looping - Particles
Looping - Particles
More like this
Finding Particle Neighbours
Finding Particle Neighbours
More like this
Delete Particles Below RW Surface
Delete Particles Below RW Surface
More like this
Randomization - Delete Particles
Randomization - Delete Particles
More like this
Particle Properties
Particle Properties
More like this
Filling Objects (Dyverso)
Filling Objects (Dyverso)
More like this