Pass PLY or OBJ to external command line then back again?

   2715   2   2
User Avatar
Member
11 posts
Joined: Dec. 2015
Offline
Relatively new to Houdini and not sure it will be able to do what I want.

I have a command line tool that I want to use to decimate raw scans. Often my input mesh will have millions of triangles.

I want to open this original scan with a file SOP, I may then reduce the polys in Houdini using PolyReduce an perhaps other processing nodes and then pass the resulting mesh to my external program, this clie program takes a few parameters and writes out a new decimated OBJ file, this time with Quads, and then I want to pull that new decimated OBJ file back in to my Houdini network for further processing.

I'm pretty sure this will need a Python node to handle the output and then input of the OBJ file required by my external cli tool. But if there's an easier way that'd be great.

Is the above possible (i.e. pass geometry as OBJ to an external program)? I want to do all of this within an asset because ultimately I want to use this with Houdini Engine and UE4. I want to be able to expose filepath to pick a raw input scan within UE4 and have it generate and spit out the new mesh based on the input file all while I staying inside the UE4 GUI.

Hope this makes sense.
User Avatar
Member
1743 posts
Joined: March 2012
Offline
Rob Eastham
then pass the resulting mesh to my external program, this clie program takes a few parameters and writes out a new decimated OBJ file, this time with Quads, and then I want to pull that new decimated OBJ file back in to my Houdini network for further processing.
The Unix SOP, (which, contrary to its name, works on all platforms), should be able to do something this. You might need to use a File SOP set to “Write Files”, then a Unix SOP, then a File SOP set to “Read Files”, since I think the Unix SOP may only have special handling for directly writing/reading its input/output as geo or bgeo format files (e.g. stdin.bgeo for the input and stdout.bgeo for the output).
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
6205 posts
Joined: July 2005
Offline
Unix SOP is built around pipes. So if your command line program can take the geometry on stdin, and write its output to stdout, you can then pipe it through gwavefront to run on a single unix sop.

If your command line tool requires filenames, you probably need a python SOP that explicitly saves, executes, and re-loads.
  • Quick Links