sibarrick Posted June 28, 2004 Share Posted June 28, 2004 Small otl offering.... All it does is sort prims using a user entered order. Don't know why the sort sop doesn't allow this.... but I got fed up waiting for the rfe to be implimented OPsort.zip Quote Link to comment Share on other sites More sharing options...
Mario Marengo Posted June 29, 2004 Share Posted June 29, 2004 Hahaaaaaa! That's Great!!! "How to Twist and Bend Houdini To Do your Bidding", by Simon Barrick. Very nice; thanks! Quote Link to comment Share on other sites More sharing options...
sibarrick Posted June 30, 2004 Author Share Posted June 30, 2004 If there were more hours in a day than particles in the universe I could learn to program properly and use the HDK itself Now, if they would just create a VOP style editor for HDK then sparks would really fly. Quote Link to comment Share on other sites More sharing options...
edward Posted July 1, 2004 Share Posted July 1, 2004 I see. I guess the advantage for this method is that you can use normal patterns. Ordered groups might even work. Otherwise, something like arg($PR, "2 3 4 1 0") would work in the Sort SOP. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted July 1, 2004 Author Share Posted July 1, 2004 Maybe it should work, but it doesn't. Not in H6.6.87 anyway. I tried your expression in expressions and in shift and it don't do nothin' Has this changed in H7 maybe? Please don't tell me I just wasted 10 minutes making this otl all for nowt. Quote Link to comment Share on other sites More sharing options...
dobe Posted July 1, 2004 Share Posted July 1, 2004 Hello Simon, reverse the order in the expression [arg(" 2 1 3 4 6 5 0 7 8" ,$PR) ] and it works. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted July 1, 2004 Author Share Posted July 1, 2004 Ah yes, should have spotted that, since I use the arg expression in my otl. Still doesn't do ranges though. Quote Link to comment Share on other sites More sharing options...
anakin78z Posted July 1, 2004 Share Posted July 1, 2004 There's a problem with that. If you specify fewer arguments than faces, the result will not be correct. Say you have a box, 6 faces. Take simons sop and specify '1 0 5 3 4'. It'll create the result you expect. Now try the sort sop with this expression: arg("1 0 5 3 4",$PR) . The result is different. If you do this: arg("1 0 5 3 4 2",$PR), it will work, but you had to give a number for every primitive. Say you have 13048 faces, and you want to order a few of those to number from 0 to 10? What then sesi, what then? I was actually trying to find a nicer solution yesterday, cause I hate the delete sop, and I don't think Simons solution keeps point counts & numbers the same. -z Quote Link to comment Share on other sites More sharing options...
sibarrick Posted July 1, 2004 Author Share Posted July 1, 2004 How do you mean, doesn't keep point counts and numbers the same? If i pump in an object with 90 points and x prims I get one out with 90 points and x prims.... or do you mean something else? Quote Link to comment Share on other sites More sharing options...
edward Posted July 2, 2004 Share Posted July 2, 2004 Sorry, for the expression error. But you guys got my point anyhow. Then you do something like this: if( $PR < 5, arg("1 0 5 3 4", $PR), 2 ) ? Quote Link to comment Share on other sites More sharing options...
sibarrick Posted July 2, 2004 Author Share Posted July 2, 2004 nice, good for most situations, this should definitely be in the help. Gets a bit hairy though if you need something complex, like 2-3 5 9-7 6 0 99-100 98-10 1...... I know you can do this, can't be bothered myself, maybe it could be an odchallenge! Quote Link to comment Share on other sites More sharing options...
anakin78z Posted July 6, 2004 Share Posted July 6, 2004 How do you mean, doesn't keep point counts and numbers the same?If i pump in an object with 90 points and x prims I get one out with 90 points and x prims.... or do you mean something else? put down a box sop, append your Prim Sort sop, and enter a pattern. Whereas points were consolidated before, the geometry is now faceted, and you have 24 points instead of 8. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted July 6, 2004 Author Share Posted July 6, 2004 Oh i see what you mean i usually only use it for discreet polys. Surely you can just append a fuse sop to put it back how it started with just the 8 points? Quote Link to comment Share on other sites More sharing options...
anakin78z Posted July 29, 2004 Share Posted July 29, 2004 sure, if you only started with 8 points! Quote Link to comment Share on other sites More sharing options...
exel Posted July 29, 2004 Share Posted July 29, 2004 reverse the order in the expression [arg(" 2 1 3 4 6 5 0 7 8" ,$PR) ] and itworks. Pretty nice, thanks Ed, Simon, etc... So much of Houdini's power lies in little tricks like these that keep everything procedural and minimize "grunt work"... I'd LOVE to see examples of these tricks start showing up in the SOP's help pages, thats the first thing everyone looks at when they've got a question, no? -JS- Quote Link to comment Share on other sites More sharing options...
sibarrick Posted July 29, 2004 Author Share Posted July 29, 2004 Sorry to drag this up again, but I've just realised that using the arg("3 2 1 0",$PR) method works completely oppositely to my primsort.otl. So watch out. Basically in my method you enter the order that you want to the prims to be sorted into, whereas using the arg expression in a sort sop you do the reverse, you have to specify what prim number you want each current prim to turn into, in the order 0 1 2 3 4.. etc Anyway it's difficult to describe but if you are interested. I can understand why you wouldn't be see the attached. Quote Link to comment Share on other sites More sharing options...
sibarrick Posted July 29, 2004 Author Share Posted July 29, 2004 also, Anakin78z, I take your point. The original reason for this post really was to prove that this was a function that was required in Houdini. I think your point probably proves even more that it should be in there. Expressions and Otls can only go so far. It seems like such a basic function, and must be almost trivial to implement I don't know why it is missing. 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.