Jump to content

Prim Sorting


sibarrick

Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

I know you can do this, can't be bothered myself, maybe it could be an odchallenge! :D

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 4 weeks later...
reverse the order in the expression [arg(" 2 1 3 4 6 5 0 7 8" ,$PR) ] and it

works.

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-

Link to comment
Share on other sites

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. :blink: 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 :rolleyes: see the attached. :ph34r:

Link to comment
Share on other sites

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.

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