Instant Meshes Bridge Sop

   74077   93   22
User Avatar
Member
240 posts
Joined: Nov. 2012
Offline
Hey everybody,

I put together a quick little SOP that lets you call instant meshes from inside Houdini.

For those that don't know, instant meshes is a really cool open source software that does a great job with quad remeshing.

https://github.com/wjakob/instant-meshes [github.com]

So I made a little sop that wraps around the command line interface for it and will remesh and bring it back into Houdini for you. The awesome model is done by Mike Pavlovich [artstation.com].



Behind the scenes what it's doing is saving off the input geo as an OBJ, running the instant meshes commandline and then bringing the output obj back into Houdini. Saves you a few steps.

Unfortunately the cool feature of combing the topology isn't available commandline, but you can still get some pretty nice results with the defaults.

To use it, download the instant meshes exe and point to it in the Setting tab of the SOP, and then setup some OBJ paths for the temp data (somewhere writable)



You can download the HDA HERE [kruelgames.com]

Then just select your target polycount and hit Bake!



Let me know if you have any questions! And I hope someone finds it useful

Edited by lkruel - June 17, 2016 15:50:58
Luiz Kruel
Senior Technical Artist
SideFX
User Avatar
Member
181 posts
Joined: Feb. 2013
Offline
Neat, this looks like a promising system. I'll have to spend some time with the tool to understand the parameters.
User Avatar
Member
240 posts
Joined: Nov. 2012
Offline
Yeah, let me know if you need any help. It should be pretty straight forward.

Here's an example done to a Pyro mesh.

Left is IsoOffset, Middle is InstantMeshes, Right is Remesh

For this case I actually used the remesh data to feed into InstantMeshes as it gave better results

Attachments:
instant_meshes_pyro.jpeg (125.4 KB)

Luiz Kruel
Senior Technical Artist
SideFX
User Avatar
Staff
4195 posts
Joined: Sept. 2007
Offline
Very cool Luiz, nice and simple!

I had to modify one section so it'd run on Linux (the dialog suppression stuff):

    si = None
    if os.name == 'nt':
        si = subprocess.STARTUPINFO()
        if hide_instant_meshes_dialog:
            si.dwFlags |= subprocess.STARTF_USESHOWWINDOW

Thanks for sharing!
I'm o.d.d.
User Avatar
Member
181 posts
Joined: Feb. 2013
Offline
Impressive processing performance within the Instant Meshes application.




But I'm not sure I'm linking the HDA to the executable properly on Mac OS X:



Because the Bake button produces an error notice:



Maybe something like goldleaf's adjustment is also applicable here.
User Avatar
Member
240 posts
Joined: Nov. 2012
Offline
Hey Cyzor

Yeah the fix that he did will work for you too. I'll update the HDA and post again.

You can also unchecked the hide dialog box and that might work
Edited by lkruel - June 18, 2016 11:18:08
Luiz Kruel
Senior Technical Artist
SideFX
User Avatar
Member
240 posts
Joined: Nov. 2012
Offline
Uploaded a new version over the existing one with goldleaf's fix. Let me know if that works for you now
Luiz Kruel
Senior Technical Artist
SideFX
User Avatar
Member
181 posts
Joined: Feb. 2013
Offline
Success with the updated HDA.

The node sometimes produces an empty output file if “desired vertex count” is too high. And if it's too low, the resulting mesh naturally doesn't have enough resolution.



Looks like it'll take some adjustment to find the right balance.

Thanks for the resource!
User Avatar
Member
240 posts
Joined: Nov. 2012
Offline
Interesting… I haven't had any issues so far. I usually have done things from 50k down to 1k. One thing that I noticed helped was running the mesh through the remesh node before feeding it to Instant Meshes. Maybe try that?
Luiz Kruel
Senior Technical Artist
SideFX
User Avatar
Member
181 posts
Joined: Feb. 2013
Offline
Thanks for the tip, Luiz. Helped me understand the issue. Turns out the polygon target range I'd been using was just too low.

Thanks!

User Avatar
Staff
4195 posts
Joined: Sept. 2007
Offline
Hey Luiz, I hope you don't mind, I added a version that cooks itself, and does all the obj bookkeeping behind the scenes; should make it friendlier for batch processing geometry.



It has a Cache SOP to take care of cooking if something changes per-frame, or just to stash the results, without requiring pressing bake. Since it uses $TEMP, it ‘should’ be cross-platform! Holler if it goes wrong!



You can switch between the two versions by adding the Operator Type Bar to the parameter pane. Go to Asset > Manage Asset Libraries… > Configuration ), and towards the bottom of that window set Operator Type Bar to Display Menu of All Definitions.

If only the guide curves were a command-line option too… *sigh*

Hope it's useful!

*edit* added a hip file

Edited by goldleaf - June 23, 2016 21:33:14

Attachments:
autocook_instant_meshes.hipnc (57.8 KB)
instant_meshes_bridge.hda (90.2 KB)

I'm o.d.d.
User Avatar
Member
240 posts
Joined: Nov. 2012
Offline
Hahaha! That's why I love open source development!

That's so awesome! That was on my todo list and you implemented it better than I would've.

I originally did it with the bake button because I thought it would be too slow (because i was testing with 7million poly meshes), but when I did the test with the Pyro I thought that it could probably work like a regular sop.

Where can I download it? And can I add it to our Game Development Tools? The last thing I want to do is stash the executable path somewhere like a global variable to if you create a new node you don't have to fill it out.

Thanks a lot!

And yeah, command line options for the guided inputs and adaptive resolution (so you don't get even quads) would be nice updates.
Luiz Kruel
Senior Technical Artist
SideFX
User Avatar
Staff
4195 posts
Joined: Sept. 2007
Offline
Thanks, glad it's helpful!

lkruel
Where can I download it? And can I add it to our Game Development Tools?

Ah, I somehow deleted the attachment when I originally posted; it's back now! And yes of course, feel free to add it!

lkruel
And yeah, command line options for the guided inputs and adaptive resolution (so you don't get even quads) would be nice updates.

I wish the guides input was a bit easier to pull apart from the GUI application, because this would make an awesome SOP! Even for non-games, being able to remesh VDB fractures to get better topology would be super helpful. But this is nice to have until that happy day! Thanks for starting it!

Cheers!
Edited by goldleaf - June 23, 2016 21:48:16
I'm o.d.d.
User Avatar
Staff
4195 posts
Joined: Sept. 2007
Offline
I just had another idea though: why not include an option to download the tool and stick it in the user's Houdini config dir? Maybe as a pop-up window the first time it launches; then download the one corresponding to their OS and stick it in $HIH. Then the OTL could point to (as an example) $HIH/bin/instant_meshes by default.
I'm o.d.d.
User Avatar
Member
240 posts
Joined: Nov. 2012
Offline
Yeah, that's a good point. I'll look into that one!
Luiz Kruel
Senior Technical Artist
SideFX
User Avatar
Member
1799 posts
Joined: Oct. 2010
Offline
Luiz! amazing work! thank you for doing this as this is super useful (goldleaf, thank you for the update too!)
-G
User Avatar
Member
240 posts
Joined: Nov. 2012
Offline
Thanks Gianny. I have an update the incorporates goldleaf's fixes and adds another layer of caching (caches the high_obj so you don't have to reexport it when you're tweaking polycounts). I'll upload it this week, just testing it as a part of a larger pipeline.
Luiz Kruel
Senior Technical Artist
SideFX
User Avatar
Member
1799 posts
Joined: Oct. 2010
Offline
Awesome! thank you. I am going to be out of town next week, but going to forward this to the peeps at work
-G
User Avatar
Member
66 posts
Joined: Feb. 2017
Offline
This looks great! Can anyone confirm compatibility with H16? I'm not able to get it to work as it errors saying it cannot read the output .bgeo. No output .bgeo gets generated so I'm sure that has something to do with it.

Thanks for any input getting this working. Looks really nice.
User Avatar
Staff
4195 posts
Joined: Sept. 2007
Offline
Hey @9krausec, it works for me using 16.0.557; which OS are you using?
I'm o.d.d.
  • Quick Links