Jump to content

Trigger Python Script on Collision how?


danylyon

Recommended Posts

Hi

I have a POP network with a collision. Now I would like to trigger a Python script (Function) whenever a Particle collides. Ideally with the informations of the Particle. How can I do that? If it's Possible?

Oddly there's no Python Operator Type for POP, or am I missing something.

Still quite new to Houdini.

Link to comment
Share on other sites

dopends on what are you trying to do with that script

you can use python script on any POP node any parameter, for your case some node which evaluates per particle for example attribute POP, and when you limit that node just for just collided particles, it will run that script just on them, but it's always safer to check inside of that script if that particle has collided and then run main body of the script

or if you don't need this data for next frame evaluation, you can just make python SOP and process your cached particles, they will have all information about collisions baked in

or you can run your particle sim in dops using popsolver for popsim and sopsolver for python geo processing

Link to comment
Share on other sites

It certainly sounds like you are trying to use Python for something you wouldn´t need in Houdini. If you are coming from some other package there´s a tendency to try to use script for something like this while it is perfectly doable with the regular tools.

Link to comment
Share on other sites

Thanks for quick answers.

Tomas, yes that clicked, but I was'nt able to get the point data into a python script. So I tried it differently.

Javiar.. hehe, yes I guess you're right. If you have a hammer, everything looks like a nail ;-)

I'm triing to build it in a SOP Solver context now.

What I want to do is: On collision, I want the particles to deform a geometry. Basically taking their velocity and add it to the geometrys points.

My problem now is. How do I get the POP network into the SOP Solver Context? Or into a VOP SOP?

Link to comment
Share on other sites

Thanks for quick answers.

Tomas, yes that clicked, but I was'nt able to get the point data into a python script. So I tried it differently.

Javiar.. hehe, yes I guess you're right. If you have a hammer, everything looks like a nail ;-)

I'm triing to build it in a SOP Solver context now.

What I want to do is: On collision, I want the particles to deform a geometry. Basically taking their velocity and add it to the geometrys points.

My problem now is. How do I get the POP network into the SOP Solver Context? Or into a VOP SOP?

There is a example file for this using the popsolver in DOPS called dentingWithPops.

Maybe you can get a idea there.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...