Jump to content

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

Link to comment
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

Link to comment
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.

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