Jump to content
Rikrok

How to remember if primitive/point was in a group

Recommended Posts

I'm trying to get points put into a group based on whether they have been contained by another shape. The first part is fine, but once the shape has moved on they're no longer in that group- I need them to stay in it (remembering if they have been touched or not.)

I tried creating an attribute with the idea to set a value for anything in the group, but of course once they leave the group that attribute reverts to the default value...

Share this post


Link to post
Share on other sites

Have a look into the SOP solver, either in DOPs or I think in H12 it's called something like Geometry Solver at SOP level...

So what you'll do is create an attribute called $INGROUP or something.

Do a max between current frame and last (in SOP solver) so, max($INGROUP, $INGROUP1)...

That way if it's 0, it'll take 1, if it has ever been 1, it'll stay like that.

Then group off that attribute.

*just looking at my dropbox, I have a file that looks like it'll do the right thing. Haven't checked it, but by the name it is probably what you want.

Hope that helps

Christian

preserveGroup_sopSolver.hip

Share this post


Link to post
Share on other sites

Hope that helps

Christian

Thanks very much, your example is doing exactly what I described.

At the risk of sounding ungrateful/stupid, I'm just starting out with Houdini coming from Maya, and I must say I'm having trouble getting my head round some things (I've failed even with your scene to recreate it from scratch). Does it really have to be this complicated? In Maya I'd simply say, if (x==otherobject.x) $samex = 1; and bang, I've got a variable that tells me whether something was at the same coordinate as another.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×