Search - User list
Full Version: Instant Meshes Bridge Sop
Root » Work in Progress » Instant Meshes Bridge Sop
lkruel
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

Cyzor
Neat, this looks like a promising system. I'll have to spend some time with the tool to understand the parameters.
lkruel
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
goldleaf
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!
Cyzor
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.
lkruel
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
lkruel
Uploaded a new version over the existing one with goldleaf's fix. Let me know if that works for you now
Cyzor
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!
lkruel
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?
Cyzor
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!

goldleaf
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

lkruel
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.
goldleaf
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!
goldleaf
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.
lkruel
Yeah, that's a good point. I'll look into that one!
grayOlorin
Luiz! amazing work! thank you for doing this as this is super useful (goldleaf, thank you for the update too!)
lkruel
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.
grayOlorin
Awesome! thank you. I am going to be out of town next week, but going to forward this to the peeps at work
9krausec
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.
goldleaf
Hey @9krausec, it works for me using 16.0.557; which OS are you using?
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB