Jump to content

Using Posprim Attribute From Pops To Sops


RickWork

Recommended Posts

Hello,

This is kinda similar to this thread here:

Staining an object thread

What I'm trying to do is change the primitive colors of my collision geometry once a particle hits the primitive. Maybe making each primitive darker as each particle collides with it.

In my popnet I have a collisionPop set to slide on collision with creates the posprim attribute. From what i understand, this is the primitive number where the particle has collidied with. This is fine and dandy and am able to create a new attribute in sops using these primitive numbers.

The part I'm stuck at is where do I go from here? I have tried grouping the primitives of my collision geomtery (so I change change the color) using the prim expression grabbbing the posprim attribute but that doesn't appear to be correct.

I have a attched a hip file at my attemps. Perhaps it's something fundamental that I'm overlooking?

Cheers,

/Rick

PosPrim.hipnc

Link to comment
Share on other sites

Rick,

I looked at this, I'm still pretty new in Houdini, but I deleted points based on on $POSPRIM# (deleting non selected) as well as $HITTIME,then refrenced those delete sops for number of points, which I used to control the color, I don't think your group sop is working the way your trying to use it, you can delet those last two sops on the grid sop the'yre not necessary..I know there are tons of different ways to solve every problem, so before I just give you the file see if this helps, if not, I'll post the file...

3db.

Link to comment
Share on other sites

Oh forgot to mention -- I changed a few things in the popnet too, made the collision POP create a group for the collided points and used the "preserve group" option to, uh... preserve the group.

WOOPS--

That last post probably didn't make much sense, I meant to tack on an extra comment and wound up removing my original message. Lets try this again:

Hey Rick,

I think I got it... and without using the SOP Solver smile.gif Learned a little bit myself while I was at it. I did what Wolfwood would call a "sleazy" trick, using the partition SOP and the "pointlist" and "argc" expressions. I took your file and just for kicks I upped the resolution of the grid and changed the particle animation to try to illustrate the effect clearly. It seems to work, dig the attached file, I put comments on the important SOPs in there... enjoy!

-JS-

Oh forgot to mention -- I changed a few things in the popnet too, made the collision POP create a group for the collided points and used the "preserve group" option to, uh... preserve the group.

PosPrim_accumulation_wackyness.hipnc

Link to comment
Share on other sites

I knew there was a more elegent way then the way I was doing it, like you pointed out excel had there been more primitives I would have to have the same number of delete sops, which would get UGLY...thanks for the file that's very cool what you did there... and just fyi in you argc expression "_"+$PR == "_$PR", you only save 1 keystroke here, but can be useful in more complicated expressions, apparantly Houdini evaluates the $ even inside quotes....

Link to comment
Share on other sites

  • 6 months later...

This is really helpful exel! One issue I always run into and I found it in your example is why primitive zero translates, or why it seems to be added to the partition. Specifying the collision_points group fixes it, but why does it happen in the first place. It was explained to me long ago, but I tend to forget low-level details like this. Garman explained it to me last spring, and I forgot again a month later.

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...