RickWork Posted July 9, 2006 Share Posted July 9, 2006 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 Quote Link to comment Share on other sites More sharing options...
3dbeing Posted July 16, 2006 Share Posted July 16, 2006 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. Quote Link to comment Share on other sites More sharing options...
exel Posted July 17, 2006 Share Posted July 17, 2006 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 Quote Link to comment Share on other sites More sharing options...
RickWork Posted July 17, 2006 Author Share Posted July 17, 2006 freakin brilliant! sigh , here's just way too many expressions to memorize Very neat setup. Thanks for your help! /Rick Quote Link to comment Share on other sites More sharing options...
exel Posted July 17, 2006 Share Posted July 17, 2006 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 Quote Link to comment Share on other sites More sharing options...
RickWork Posted July 17, 2006 Author Share Posted July 17, 2006 Also thanks very much for your comments especially the one on the attribute Create Sop that generates the primitive attribute. At first sight, I was totally lost but with your comments, it's much clear now. Thanks! /Rick Quote Link to comment Share on other sites More sharing options...
3dbeing Posted July 18, 2006 Share Posted July 18, 2006 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.... Quote Link to comment Share on other sites More sharing options...
edward Posted July 19, 2006 Share Posted July 19, 2006 apparantly Houdini evaluates the $ even inside quotes.... FYI, you need to use single quotes of you want to prevent expansion. Or use backslash escaping. Quote Link to comment Share on other sites More sharing options...
3dbeing Posted July 19, 2006 Share Posted July 19, 2006 That's good to know, thanks ed.. 3db. Quote Link to comment Share on other sites More sharing options...
steven Posted January 31, 2007 Share Posted January 31, 2007 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.