Use particles with getCollidingObject() ??

Post Reply
Posts: 55
Joined: Wed Sep 19, 2012 2:42 pm

Use particles with getCollidingObject() ??

Post by izo » Tue Jun 03, 2014 7:54 pm

Hey all,

I'm not super awesome at scripting, but I'm giving it a go...
I have a sweaty bottle here with particles emitted from an object, then I'm running a bigger drop down the bottle emitter from a sphere-emitter.

What i'd like to do is use getCollidingObject to move colliding particles to the sphere-emitter when they're colliding with the same emitter.
I'm guessing that's not supported atleast not with getCollidingObject, or did I just make an error in the script?

def onSimulationStep():
e = scene.get_PB_Emitter("Object01")
t = scene.get_PB_Emitter("Sphere01")
parts = e.getParticlesColliding()
for p in parts:
obj = p.getCollidingObject()
if (obj.getName() == t):
t.addParticle(p.getPosition(), p.getVelocity())

Anyhow, I'd love some suggestions on pulling this off, tried with filterdaemon but even though that attribute is called particle collisions, it seems to only react to objects.

THanks for any help!

User avatar
Site Admin
Posts: 143
Joined: Mon Jun 14, 2010 9:35 am

Re: Use particles with getCollidingObject() ??

Post by Alex » Tue Jun 03, 2014 8:48 pm

Hi izo,
You could try to test the neighbours instead of the collision flag.

I don't have the documentation here right now, but in case you can't ask a particle which emitter it belongs to, you can check if it is inside the array of the Sphere emitter particles.

Best regards
Alex Ribao
RealFlow Team
Next Limit Technologies

Post Reply