Exporting Houdini scene to WebGL/three.js

   2071   13   3
User Avatar
Member
28 posts
Joined: Nov. 2017
Offline
I'd like to export a whole Houdini scene: camera, lights, geometry, materials, textures and animations so I can load it into a high quality PBR-based three.js/WebGL web app. What's the best-practices way to do that with Houdini 16.5? I know Houdini exports lots of formats, and three.js can convert and/or read directly lots; I'm hoping folks here have good experience to share.
User Avatar
Member
471 posts
Joined: June 2006
Offline
Just checked there is a scene file format.

https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4 [github.com]

It look like you need some python to create a exporter. You can export geometry files in houdini but no scene file.
User Avatar
Member
28 posts
Joined: Nov. 2017
Offline
I'm not sure that scene file format is implemented properly/completely. But three.js can load glTF (https://threejs.org/docs/#examples/loaders/GLTFLoader). Can Houdini export glTF? Seems like no, which is too bad. Three.js also supports COLLADA; can Houdini export COLLADA (dae)?
User Avatar
Staff
595 posts
Joined: July 2005
Offline
garyo
I'm not sure that scene file format is implemented properly/completely. But three.js can load glTF (https://threejs.org/docs/#examples/loaders/GLTFLoader). Can Houdini export glTF? Seems like no, which is too bad. Three.js also supports COLLADA; can Houdini export COLLADA (dae)?

Your request for GLTF support has been noted.

See also this thread here: https://www.sidefx.com/forum/topic/53079/ [www.sidefx.com]

Cristin
User Avatar
Member
471 posts
Joined: June 2006
Offline
my bad didn't seen that gltf 2.0 supports scene setup's.

https://github.com/KhronosGroup/glTF/blob/master/specification/2.0/figures/gltfOverview-2.0.0a.png [github.com]
User Avatar
Member
28 posts
Joined: Nov. 2017
Offline
I must be missing something – I can't even export a basic object with PBR (prinicipledshader) material and a texture. I've tried Alembic and FBX and obj, but all of those only get the geometry and miss the material settings and texture (at least with the settings I've tried). I'm using Houdini 16.5 Indie; is this an Indie limitation or am I just not doing it right?
User Avatar
Member
15 posts
Joined: March 2010
Offline
mandrake0
It look like you need some python to create a exporter. You can export geometry files in houdini but no scene file.

Check out https://github.com/dkoerner/houio/tree/master/scene_exporter [github.com]. This python script exports the current scene in houdini to a json description file. Exported are cameras, objects (not including sops), lights and some animated parameters. It is very rudimentary and does not support materials etc. But it might be a good starting point for writing your own exporter.
User Avatar
Member
28 posts
Joined: Nov. 2017
Offline
skydave

Check out https://github.com/dkoerner/houio/tree/master/scene_exporter [github.com]. This python script exports the current scene in houdini to a json description file…

Wow, I didn't expect that Houdini would have no way to export a full scene! I have written a full glTF exporter before, but I'm hoping not to have to do it for Houdini; it's a good chunk of work. And when/if SideFX does implement glTF export that work would be wasted.

At this point I've tried fbx and Alembic, and neither one exports even basic principledshader or textures. Are there other 3rd party exporters?
How do people use Houdini to develop assets for games? Just use it for geometry (exporting obj) and recreate all materials and textures in some other software?
User Avatar
Staff
595 posts
Joined: July 2005
Offline
garyo
skydave

Check out https://github.com/dkoerner/houio/tree/master/scene_exporter [github.com]. This python script exports the current scene in houdini to a json description file…

Wow, I didn't expect that Houdini would have no way to export a full scene! I have written a full glTF exporter before, but I'm hoping not to have to do it for Houdini; it's a good chunk of work. And when/if SideFX does implement glTF export that work would be wasted.

At this point I've tried fbx and Alembic, and neither one exports even basic principledshader or textures. Are there other 3rd party exporters?
How do people use Houdini to develop assets for games? Just use it for geometry (exporting obj) and recreate all materials and textures in some other software?

Maybe my comment earlier was a little too subtle. If you can wait a bit, you won’t have to write it for Houdini.

Cristin
R&D SideFX
User Avatar
Member
2 posts
Joined: June 2018
Offline
Hi there,

our studio is quite new at working with Houdini. However, we already love it as part of the digital asset creation for our offline rendering pipeline.

However, we'd love to have a proper workflow for having instances of digital assets created by Houdini in a WebGL-Environment. We'd prefer Babylon Js. For maya there is a .babylon exporter but not for Houdini however.

Is there some way to get that? It's in a json format.
User Avatar
Member
28 posts
Joined: Nov. 2017
Offline
Houdini 17 supports glTF 2.0 import and export. Still a little wobbly in places but it's getting there. Babylon.js accepts glTF 2.0; that's probably your best bet.
User Avatar
Member
3352 posts
Joined: Sept. 2007
Online
I wish I were smart enough and/or had enough time to implement HEngine for three.js; would love to embed live HDAs in documentation…
I'm o.d.d.
User Avatar
Member
23 posts
Joined:
Offline
goldleaf
I wish I were smart enough and/or had enough time to implement HEngine for three.js; would love to embed live HDAs in documentation…

I wish for this too!
User Avatar
Member
3 posts
Joined: April 2019
Offline
Hi there,

It's been about 8 months since this post was initially created - and it looks like a GLTF export has made its way into Houdini!

I've got a couple of questions regarding the export process:

- Does the exporter support animations and multiple animations?
- I have created a very simple geometry with about 5 different poses (1 frame animations). I did this using the Houdini Animation Editor. How can I get these animation actions / poses to be exported via GLTF? I cannot seem to get these animations exported.

My goal is to export the model with the various poses, and import them into ThreeJS as different animation clips which I can then assign weights to as required.

I should note that I'm more of a developer than an artist, so I'm not sure if my terminology is correct. Please let me know if you need more info.

Also, exporting as FBX (which can be imported into ThreeJS) won't work because as far as I know, FBX only supports a single animation track, not multiple.

Thanks in advance for any help..
  • Quick Links