Use particles with getCollidingObject() ??

Discussion about scripting with Python
Posts: 4
Joined: Thu Feb 14, 2013 10:06 am

Use particles with getCollidingObject() ??

Postby izo » Tue Jun 03, 2014 6:53 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!

Return to “Python-Scripting”

Who is online

Users browsing this forum: No registered users and 2 guests