Re-sorting model vertices

   3030   4   2
User Avatar
Member
2 posts
Joined: June 2008
Offline
Hey Forums! I am primarily a Cinema4D user in motion graphics. Years ago, a Houdini artist wrote a simple scene for me that would read an OBJ, then run it through a Sort SOP and save it out as another OBJ.

I remember the Sort node had options for what direction the vertices would be sorted. This is incredibly useful in motion graphics when I need to control the order of how polygons are constructed. Cinema 4D has no native tool like this.

I don't know the first thing about Houdini, so it's a really steep learning curve for me.

I'd like to ask a huge favor (and probably something very easy for you experts): Could you please write a scene like this for me to use?

If I recall correctly, it's a very simple 3-node scene (read>sort>write).

I'd be happy to donate some PayPal $ or Square Cash in your direction for such a helpful tool. (The company I'm currently working has Houdini 15 if there's a compatibility issue with scene projects.)
——————- end of line
User Avatar
Member
1743 posts
Joined: March 2012
Offline
The attached example has a File SOP to read in an OBJ file named “input_file.obj” in the directory containing the HIP file ($HIP). There's a Sort SOP that's currently set to do nothing, because I'm not sure what you'd like to sort points/primitives by. Then, there's an output ROP that you can press the Save to Disk button on to write to “output_file.obj” in the directory containing the HIP file.

You'll need to change the Sort SOP to sort points/primitives however you'd like them to be sorted. If you have any questions, feel free to ask. I'd hold off on paying someone to do something so simple.

Attachments:
OBJ_Sort_Example.hip (53.6 KB)

Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Member
2 posts
Joined: June 2008
Offline
ndickson
The attached example has a File SOP to read in an OBJ file named “input_file.obj”

Wow! Thank you so much for the lightning fast reply! I can't wait to try it out this morning!
Edited by Dr_Pizza - May 4, 2017 13:04:53
——————- end of line
User Avatar
Member
1743 posts
Joined: March 2012
Offline
Dr_Pizza
Wow! Thank you so much for the lightning fast reply! I can't wait to try it out this morning!
No problem. It apparently only took 79 seconds to create that file, so I figure it's worth it, haha.
Writing code for fun and profit since... 2005? Wow, I'm getting old.
https://www.youtube.com/channel/UC_HFmdvpe9U2G3OMNViKMEQ [www.youtube.com]
User Avatar
Staff
3465 posts
Joined: July 2005
Offline
and 5 minutes to make an HDA.

Attachments:
obj_sort_sop.hda (17.5 KB)

Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
  • Quick Links