sibarrick Posted February 11, 2006 Share Posted February 11, 2006 (edited) Ok so this has bugged me for years and finally I got round to writing one. It basically works like this, geometry in one input and curve sop in the second. The curve sop just needs to have been snapped to the edges or points of the geometry you want to split. Now this is all well and good but I wanted to extended it to multiple curves. This nearly works but for some reason I can't see at the moment in some situations some edges don't cut..... if anyone has any pointers I'd appreciate it. Feed each curve in one at a time and they work, combine them together and they don't. To see what I mean I have included a test hip file. Now I can only assume this is something to do with something in the gdp not getting updated properly when I loop round to do the second curve, but when I try and test this by doing a cout on the poly number that is getting cut it causes the whole sop to crash, I'm well confused I've missed something obvious and if anyone could spare a fresh pair of eyes to spot it that would be great. PolyCrease.zip Doh! of course the closest point isn't necessarily a point on the edge I need. How obvious, hmmm have to add some more checks.... No that's not it, it is an issue but not in the current examples... hmmm still stuck. Edited February 11, 2006 by sibarrick Quote Link to comment Share on other sites More sharing options...
sibarrick Posted February 11, 2006 Author Share Posted February 11, 2006 Sussed it. Its difficult to explain but I'll fix it up and repost it. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted February 11, 2006 Author Share Posted February 11, 2006 Well I know what it is but I don't know how to fix it. So I find the closest point to the curve point and then use connectedPrims->findPrimsUsingPoint(nearppt, primlist, *prefarr); to find all the prims connected to the point and then convert it to a point group using ptGroup = connectedPrims->getPointClosure(*primlist); findPrimsUsingPoint doesn't always return all the prims that are connected to the point. In my example file if I move point 1 of curve 1 down a bit it works fine. If I move it up it doesn't. Working Not working So the question is, is there anything I can do about this or is it a bug? PolyCrease.zip Quote Link to comment Share on other sites More sharing options...
sibarrick Posted February 12, 2006 Author Share Posted February 12, 2006 ok this is officially driving me nuts now. Check this out. I've updated the code to echo out properly what it is doing. It correctly finds the closest point, I then put that point in a group and expand the group by one edge. Just as I did in the edgeDepth sop I wrote recently. Now if I input the same geometry and point into that sop it correctly returns the connected points. Using the same method in this sop it returns the wrong connected points. What the heck am I doing wrong? These are the correct points connected to point 8 These are the points returned by PolyCrease Although it looks like 23 the connected points returned are actually 2 and 3 I forgot to put a space between the numbers. The more observent will notice that it still comes out with the correct final edge and split point but this is only luck in this case. Here is the code. Test2.hip is the file I used to generate the above pictures. Arrrrgh. If any kind soul can spot the blupper I will happily send them a bottle of scotch which is what I'm going to be downing in a minute, (or any drink of your choice) PolyCrease.zip EdgeFalloff.zip I've also isolated the problem down to this test sop which returns a different set of points again, even though it is just a cut down version of the other code, this new set of points is still wrong though.... slowly going mad Test.zip Quote Link to comment Share on other sites More sharing options...
edward Posted February 12, 2006 Share Posted February 12, 2006 I haven't looked at the code, but are you careful to rebuild connectedPrims after each split in the geometry? GEO_Closure builds connectivity information once at construction time and then can be used multiple times for fast queries as long as your gdp hasn't changed. If your gdp changes, then all bets are off, you need to rebuild it. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted February 12, 2006 Author Share Posted February 12, 2006 I think so I certainly try to do that, and besides even if I do two seperate splits in two seperate sops I get the same result. I even get the same result if I replace the first polycrease sop with a Houdini polysplit sop set to do the same cut. The test sop I put together doesn't even do anything it just takes a user specified point number and reports the connected points, even that doesn't work. I sent it to support so you might see it at work. It's probably me but it might be a bug. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted February 14, 2006 Author Share Posted February 14, 2006 (edited) I know I'm the only one who cares but I got the test sop working. Had to tell someone, it was driving me nuts, I think I might have said that already. Anyway now to try and get the main deal working. Hurrah! its working PolyCrease.zip Edited February 14, 2006 by sibarrick Quote Link to comment Share on other sites More sharing options...
peliosis Posted February 15, 2006 Share Posted February 15, 2006 I know I'm the only one who cares but I got the test sop working. Had to tell someone, it was driving me nuts, I think I might have said that already. Anyway now to try and get the main deal working.Hurrah! its working PolyCrease.zip 24713[/snapback] Hello Simon, it all sounds like heaven, if you told me what to do with the funky .c and .h files to install your SOP I'd be grateful:) Ok, I know I could track it down and nail by myself but there are too many of them in this software. Default polysplit is very limited, could have at least something like bandsaw ("divisions") and proper angle/orientation snapping. Quote Link to comment Share on other sites More sharing options...
peliosis Posted February 15, 2006 Share Posted February 15, 2006 I sent somehow two same posts so this is the second one edited and absolutely redundant, If somebody could delete it, please do. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted February 15, 2006 Author Share Posted February 15, 2006 If you look in the last zip file there should be a folder called dso just put that in your Houdini $HOME directory. If you are on windows that should work. As for the .c and .h files you would need to compile them using hcustom, but that requires you install Microsoft visual studio .net 2003. If you are on Linux there will be another way, check odWiki to see how if you are interested. This is still a work in progress but I'm happy that it is feasible i'd like to extended it more. On the list so far: 1. Fix the edge finding algorithm so it will work in any situation. This is easy enough and i'll add that next. 2. Embed the split in the geometry, this means it does actually cut any geometry it would just store it as an attribute. You would then apply the split further down the chain once you had applied some other edits. 3. Add all the existing functionality of polysplit, I've added the buttons they don't do anything yet. 4. Add additional side splits so that you can easily do creases where you create a V shape and indent the middle set of points. What is bandsawing? Is it what I describe in 4. What would proper angle/orientation snapping do? Also connected with this is the idea of having a Quad strips sop that uses just that one function from polysplit and allows you to pick a set of source edges that then have the quad strip funtion applied but with a user defined number of divisions. Quote Link to comment Share on other sites More sharing options...
peliosis Posted February 15, 2006 Share Posted February 15, 2006 Thanks for clearing things out. So basically the .h and .c is your source code and dso is a compiled library if I'm right. Looks like I need a newer version than 358 though. Bandsaw was a lightwave tool, it cutted through an object after selecting 2 points. Cutting line could be shifted back and forth and other parallel divisions added. There are great split tools in xsi you can have a look just for inspiration:knife tool and split with split control. Angle snap is the possibility to strike next edge at certain angle (for example holding shift snaps every 15 degrees) just what "snap to perpendicular" does with 90 degrees. Also snap to perp is busted because it fails in many cases when there is a difference in edge length. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted February 15, 2006 Author Share Posted February 15, 2006 Anything after 410 should work I think, you are correct the dso is the compiled library and the rest is the source code. It's actually compiled in 508 but it seems to work in other cuts. Bandsaw sounds like quad splits, does it work on tri's too? I'll think about the angle snaps thing, but it would probably have to be consistent for every point, either that or have some sort of dynamic parameter that allows you to specify a point number from the curve and what angle it snaps too. When is something like that useful? Quote Link to comment Share on other sites More sharing options...
peliosis Posted February 15, 2006 Share Posted February 15, 2006 Bandsaw sounds like quad splits, does it work on tri's too?I'll think about the angle snaps thing, but it would probably have to be consistent for every point, either that or have some sort of dynamic parameter that allows you to specify a point number from the curve and what angle it snaps too. When is something like that useful? 24737[/snapback] I don't remember but 99% you are right about bandsaw, it's for quads. I noticed everything depends on kind of work we do. sum one in his famous post exposed polyextrude behaviour I never spotted despite using it very often. The same with poly split, I use angle snaps everytime in xsi when modelling architecture and mechanical objects while for somebody else modelling characters it might be completely redundant. From the other hand, do you have some programming background or have you learned by yourself how to write such things? Quote Link to comment Share on other sites More sharing options...
Visual Cortex Lab Posted February 15, 2006 Share Posted February 15, 2006 Talking about polysplit... is there any Shatter effect around?.. i need to shatter a human face which then will fall in pieces (hm... seems i need something like its in the SideFX reel.. where the people falls on the floor all in pieces ). cheers. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted February 15, 2006 Author Share Posted February 15, 2006 I'm totally self taught, all from books, I have an fine art background. My code makes "real" programmers cringe but if it gets the job done I'm happy. I work with programmers and having an understanding of what is involved helps a lot especially if you are the one specing the work for them, you get more respect if you can speak their language a little. I've started learning the Hdk because I wanted more control, vex only takes you so far and writing hacks in vex was starting to take longer than learning C++. It only took a couple of weeks to get the basics enough that I could do simple things, but I have been scripting and coding in other languages for years, never formally taught though. I think you have to have some scripting and vex knowledge or know something about coding to even try it, then once you have a template of an "empty" sop many operators are much the same. If you are a good vex coder it's easy enough to explain to you the basic anatomy of a sop after that you have to glean what you can from existing code, ask lots of questions and hunt endlessly through all the headers. There are some basic help files too but I find the examples are generally more useful. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted February 15, 2006 Author Share Posted February 15, 2006 Talking about polysplit... is there any Shatter effect around?.. i need to shatter a human face which then will fall in pieces (hm... seems i need something like its in the SideFX reel.. where the people falls on the floor all in pieces ).cheers. 24741[/snapback] There was a tutorial for something very similar knocking around, I bet someone knows where, but you might want to post a more general question in a different part of the forum. Quote Link to comment Share on other sites More sharing options...
peliosis Posted February 15, 2006 Share Posted February 15, 2006 Thanks a lot Simon, I'll have to learn vex to build shaders, thats for sure. I scripted a bit for xsi in js and vb, but nothing really serious. One way I'd like to be able to create simple tools, the other I'm afraid of sacrificing too much time for something that will give only a marginal advantage. It's tough. I have a feeling that the more I learn the less I know. There are too many things and sometimes I feel overwhelmed by all this stuff : houdini,linux,renderman,mental ray,scripting,shader building. That's why I was curious is it reasonable to learn hardcore stuff without coding background. I'll start from vex, perhaps things will be more clear later on. sorry for an OT Quote Link to comment Share on other sites More sharing options...
Victor Posted February 15, 2006 Share Posted February 15, 2006 [one,Feb 15 2006, 05:12 AM]Talking about polysplit... is there any Shatter effect around?.. i need to shatter a human face which then will fall in pieces (hm... seems i need something like its in the SideFX reel.. where the people falls on the floor all in pieces ).cheers. 24741[/snapback] http://odforce.net/forum/index.php?showtop...indpost&p=23173 Here's a post from edward with a file to shatter geometry. -Victor EDIT: Fixed link. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted February 18, 2006 Author Share Posted February 18, 2006 Played around with this some more, tried to make the edge finding algorithm more solid and added quite a few features. Still need to finish the embedding and extraction parts. PolyCrease.zip a few bug fixes... PolyCrease.zip Quote Link to comment Share on other sites More sharing options...
sibarrick Posted February 20, 2006 Author Share Posted February 20, 2006 Can anyone think of any reason why the code snippet below would fail for my scratchgdp but works 100% for the actual gdp? This works GU_SplitLocPtrArray splitLocs; GB_EdgeGroup *outedges = 0; //splitLocs initialised here // outedges = createAdhocEdgeGroup(*gdp, "tmpedgegroup"); gdp->edgeSplit(splitLocs,false,true,outedges); But this doesn't GU_Detail *scratchgdp; GU_SplitLocPtrArray splitLocs; GB_EdgeGroup *outedges = 0; //splitLocs initialised here // scratchgdp = new GU_Detail(); scratchgdp->merge(*gdp); outedges = createAdhocEdgeGroup(*scratchgdp, "tmpedgegroup"); scratchgdp->edgeSplit(splitLocs,false,true,outedges); ta 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.