Jump to content

Visibilty Sop


Recommended Posts

Sorry more questions,

I'm trying to add the ability to hide primitive groups into my sop. And I need a few pointers. Here's how I'm going about this at the moment, not sure if I'm even approaching this correctly.

I've made my sop by inheriting from the visibility sop

class SOP_mySOP : public SOP_Visibility

I've also created some private member function and data that create what I'm guessing the visibilty sop needs in order to function

 
  GB_PrimitiveGroup                 *myGroup;
  GU_DetailGroupPair                myDetailGroupPair;

  int          HIDE_OR_EXPOSE()     { return HIDE; }
  int          SEL_OR_NONSEL()      { return SELECTED; }
  int          THREE_D_OR_TWO_D()   { return TWO_D_AND_THREE_D; }
  int          CUMULATIVE()         { return false; }

I don't use parameters because I always want it to do the same thing, which is hide non-selected prims.

In my cook method I set myGroup and myDetailGroupPair to sensible values. Then I call performVisibility(HIDE_OR_EXPOSE());

Now my problem is that no matter what I set myGroup and myDetailGroupPair too it always hides the entire gdp.

I'm a little confused as to the difference between myGroup and myDetailGroupPair since both require a group but I've tried setting both to a pointer to my group I want to hide and neither have any effect.

Am I going about this right? any help much apprieciated as always. :)

Link to comment
Share on other sites

Hi Simon,

I think this is actually much easier than that. Houdini picks up a special group named "__3d_hidden_primitives__" and doesn't display prims in that group. Look in GU_Types.h for GU_HIDDEN_3D_PRIMS_GROUP define and use that to add primitives to it. I think that's all you need to do to hide primitives. (The 2D visibility one is to hide primitives from the UV viewport).

Hope that helps,

George.

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