Jump to content

Edge Depth


Recommended Posts

Anyone know if there is an hdk version of the "edge depth" option in the group sop?

It lets you expand a group (in H8 at least - which is a cool addition) by specifying a number of edges away from the original group to expand by.

I want to do something similar but to have it create a falloff attribute at the same time. Any pointers?

Cheers :)

Link to comment
Share on other sites

  • 2 weeks later...

Ok so I've put this sop together that creates an attribute base on the number of connecting edges, but there is a weird error. If i have the sop selected and displayed I can change the parameters without problems and everything works as i expect. However if i display another sop in the chain then as soon as I touch one of the parameters to change it Houdini crashes. Anyone got any ideas about this? Ever seen it before? I'm not sure if it's my code or Houdini..... :(

EdgeFalloff.zip

Link to comment
Share on other sites

Hi Simon,

Those kinds of errors usually come from not locking/unlocking inputs at the right places, or fiddling with someone else's gdp. I had a very quick look through your code and couldn't see anything obviously wrong. Can you get a stack trace of where it is crashing?

George.

Link to comment
Share on other sites

I could if I knew how, can you explain how to do it?

I track it down to line 178

newGroup.generateGroup(parms);

So it's something to do with this but no idea why it should be different when displayed.....  :blink:

22562[/snapback]

Hi Simon,

To generate a stack trace on Windows is very easy, just hit "Debug" when Houdini crashes (on Linux the stack is saved in a crashlog file in /tmp).

The code that looks like it maybe the cause is the assignment of myGroup to parms.origptgroup. The basic assumption is that myGroup has to belong to the gdp you pass into newGroup on creation. In cookInputGroups, it's possible for you to create myGroup in the inputGeo() rather than the current gdp (which is what is passed to newGroup).

Hope that helps track it down.

George.

Link to comment
Share on other sites

That may well be it, I'll do some investigation. I have to admit I just copied that code from the flatten example, I never really understood this bit

// The "gdp" variable is only available if we are called from the SOP

    // itself.  So, if we are called by a handle, we have to get the

    // geometry oursevles.

What is a handle exactly in this case? I assumed it was a viewport handle, and I don't have any.

cheers for the help.

As far as I can tell inputGeo() never gets called as "alone" is always 0.

still hunting.....

<_<

The only other place that might cause a problem is this bit

prevGroup = createAdhocPointGroup(*gdp,"prevGroup");
newGroup.generateGroup(parms);
.
.
.
*prevGroup = *(GB_PointGroup*)newGroup.group();
parms.origptgroup = prevGroup;

But I still don't see why this would change just because the sop is displayed, plus the group is made correctly from the gdp.

Is there any chance that generateGroup has a bug in it?

Edited by sibarrick
Link to comment
Share on other sites

What is a handle exactly in this case? I assumed it was a viewport handle, and I don't have any.

The handle in this case is the viewport handle (or probably more accurately the selector). When the selector gets to cook (to generate the group) it has no choice but to generate it in the incoming gdp (since the current one doesn't yet exist).

Hey, I fixed it! I abandoned generateGroup and went back to using edgeDist instead, problem solved.

[Hdksupport told me to use the generateGroup method - hmmmmm hope that wasn't you george ]

Hehe -- I don't think so... :unsure: ... but it's a fine suggestion ... :)

-- Edit:

Aha! I found it. You need to initialize parms.useNumbering = 0 and parms.useBoudning = 0. These two are not initialized to 0 by the GU_GroupParms constructor (yet... :angry: ). In that case the generateGroup and edgeDist call should be close to exactly the same thing.

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