somethingtohide

somethingtohide

About Me

Connect

LOCATION
Not Specified
WEBSITE

Houdini Skills

Availability

Not Specified

Recent Forum Posts

RBD Number of Collisions per Object July 16, 2012, 10:26 p.m.

WOW!

Thank you so much, that was some of the best help I've ever received.

I'm looking at this spreadsheet and it really is a lot of data (I might be able to do better things than I thought I would)!

I'm a python programmer trying to understand some concept in Houdini, and I have another question.

I want each object in a simulation to carry some additional data, such as how many times an object has collided, or which objects it's collided with. This spreadsheet lists impacts by time, but not in an easy way so that I can query for each object the collision times.

The obvious answer to me is to have a script that executes each frame that would look at the new data for that frame, and then append the information gathered to a variable on each object. That way, I can reference something like /obj/object10 and get the variable collisionCount and use that somewhere else.

I get the feeling that I have to approach this differently in Houdini, and someone else might have a better answer. How might I gather data from this impact spreadsheet to compute new data that I can then use easily in something else, like a shader?

I guess the easier question to answer is this: Can I feed this data from the node into a Python script sort of node and use that to change attributes on other nodes? And would this script have the same locals, so I can store things across frames?

RBD Number of Collisions per Object July 15, 2012, 11:02 a.m.

I'm trying to add color to an object based on collisions, but I don't know where to start.

I want to start with a small example, so I've created a Ground Plane, sphere, and made the sphere a RBD Object. The sphere falls and bounces about three times onto the plane.

Right now, I'm trying to get the number of collisions and feed that into a rand() in a Primitive node's Add Color attribute. I've found this expression on the internet:

dopnumrecords($DOPNET,$OBJID,“Impact”,“Impact”)

But I'm not sure how to use it. It looks like it's being used in the DOP network, but I think I'll have to do it in my geo's network so that I can add the color. This is the only way I've found to access the collision count, but I need some help with how I'm supposed to get that to the object's color.

Eventually I want to possibly have the color stick to the closest points on the collision, but I'm trying to start small. Also, there would be lots of objects, so I'd need to feed in an objects ID along with the collision count to get a unique number.

Any help would be appreciated, even if you just want to guide me along finding this out myself. I haven't opened Houdini in a while, but I thought this would be a good way to get familiar again.

Connecting particles with a mesh March 30, 2012, 2:59 p.m.

Just tried adding a Tetrahedralize set to Connected Polygons. It seems to connect the ends back together as well as connecting many things, similar to what the Trail did whenever Close Rows was checked.

However, you got me on the right path. Using a Polywire after the Trail when it is set to Connect Polygons and Close Rows is off works by creating the geometry along those created lines.

Thank you for answering that for me.

That brings me to my other solution that I alluded to in my first post.

If I create a point emitter that is animated and emits points that never die, how would I go about generating cylinders on each particles birth that connect to another point? It would have to remember the point because as the emitter animates, the cylinders should stay connected to the same points so they don't jump around.

I'm just thinking this out as I'm typing it because I'm not at my machine right now.

I would need a way to execute something (a scripted node or another node chain) each time a particle is born. Then, whenever it is born, I check the nearest particles to see if they have no more than five connections. If it doesn't, then I would connect the two particles with a Line that I could then use Polywire to generate geometry, right? It would have to know the points because the particles would be moving based on the inherited velocity of the animating emitter, so the cylinders would be slowly getting longer as the points grew away from each other.

I'm attaching a file of what I ended up figuring out with your suggestion. It's as bare-bones as possible: particles animated with geometry connecting them. The Timeshift node is set to freeze it to frame 240 so that the geometry is always there. If you want to see the geometry created from the animated particles as they animate, bypass that node.