sibarrick Posted November 1, 2005 Share Posted November 1, 2005 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 Quote Link to comment Share on other sites More sharing options...
sibarrick Posted November 2, 2005 Author Share Posted November 2, 2005 I think I found it GU_PointGroup::edgeDist ( not depth) Kinda obvious really - doh! Quote Link to comment Share on other sites More sharing options...
sibarrick Posted November 12, 2005 Author Share Posted November 12, 2005 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 Quote Link to comment Share on other sites More sharing options...
George Posted November 13, 2005 Share Posted November 13, 2005 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. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted November 13, 2005 Author Share Posted November 13, 2005 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..... Quote Link to comment Share on other sites More sharing options...
George Posted November 17, 2005 Share Posted November 17, 2005 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..... 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. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted November 17, 2005 Author Share Posted November 17, 2005 (edited) 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 November 17, 2005 by sibarrick Quote Link to comment Share on other sites More sharing options...
sibarrick Posted November 18, 2005 Author Share Posted November 18, 2005 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 ] Anyhoo here it is all working EdgeFalloff.zip Cheers! Quote Link to comment Share on other sites More sharing options...
George Posted November 18, 2005 Share Posted November 18, 2005 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... ... 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... ). In that case the generateGroup and edgeDist call should be close to exactly the same thing. George. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted November 18, 2005 Author Share Posted November 18, 2005 Thanks for the follow up, solutions all round, excellent! cheers 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.