Home Creators Posts Import Register Favorites Logout

Content

As you might expect, Houdini offers a huge array of options for file input/output (I/O). In this article we'll look at many of the most common scenarios for reading and writing files.

Input

The number one way to load external files into Houdini is, naturally, the File node. Many different formats are supported, including popular ones such as FBX, Alembic and USD. Houdini also provides a native file format, .geo, that is accessible both in standard Houdini and Solaris. If you don't need DCC interoperability then it's a fine choice. Every single aspect of Houdini is supported and it's also the only cache option for Houdini Apprentice users. Alembic, USD and other export formats are available only to subscribers.

(Note that this format comes in three flavors: .geo, .bgeo and .bgeo.sc. The first is plain text, the second is binary and the last is compressed binary to save even more disk space.)

Let's add a File node and browse for something to import. Any multi-file, animated cache can be loaded using the $F syntax. In the case of this VDB explosion the files are stored on disk as pyro.1-442.vdb, so we'll read the sequence with pyro.$F.vdb. $F refers to the current frame number, with no padding. On frame 1, $F is replaced with 1, $F2 with 01, $F3 with 001, etc.

Now let's load some static Alembic geometry. The model is displaying correctly, but if we try to select a single polygon we can't.

Why is that? This file is a packed Alembic, meaning that it's loaded as a single monolithic object in order to save significant amounts memory. Check out the Geometry Spreadsheet to see this in action. There is only one point, indicating the position of the mesh in the scene.

Attach an Unpack node and the Geometry Spreadsheet is now fully populated.

Unpack defaults to Polygon Soup mode, which still restricts access to the complete mesh by treating it as one primitive surface. We can bypass this by checking Convert Polygon Soup Primitives to Polygons. We've now got access to the full raw mesh.

There is also a dedicated node specifically for loading Alembic files, called... you guessed it, Alembic! If we use this we can get the same unpacked polygons result by selecting Unpack Alembic Delayed Load Primitives and No Poly Soup Primitives.

You might prefer to use this node with more complex Alembic scenes or if you want a higher level of control, such as preventing some attributes from loading.

To compare the memory footprint of these various loading methods, let's click on the Node info icon on our Alembic node.

Click the Pin window to stay open icon to keep the info window on top as we change settings. The default packed mesh is using only 280 kilobytes of Geometry Memory. (Note that the points, primitives and vertices are all 1 in our packed geometry.)

Unpacked, we're up to 55 megabytes already. Finally, disable polygon soup and we're maxed out at 100 megabytes.

As you can see, it's vastly preferable to keep geometry packed whenever possible. The performance benefits are massive.

Houdini also offers a dedicated USD Import node for handling all forms of USD files. This method is always better than using a simple File node since USD scenes can have many different elements and we need to have specific control over them when importing.

Finally, Houdini provides a few GUI importers via the File > Import menu.

The Alembic option includes some choices for how you want your file to be processed. It drops down an Alembic Archive node in top-level /obj context. There's no particular reason to choose this workflow over simply using an Alembic node, but it might provide some useful tools in specific use cases. Note that when all is said and done it's just a wrapper around an Alembic node buried a couple levels deep.

Perhaps more useful is the FBX importer in the same menu. This gives us many options for processing an FBX file, then loads the file using a unique node structure that attempts to preserve every aspect of the original file, including materials, transforms, cameras, skeletons and more. There are also a number of FBX import nodes available, including FBX Animation Import, FBX Character Import and Labs FBX Archive Import. The interfaces to these nodes are fairly self-explanatory and they will likely prove useful when importing more complex FBX setups.

Output

The absolute simplest way to save something to disk in Houdini is to right click on a node and select Save > Geometry.

This will provide a bare-bones export with zero customization options. We can use this to pop out a quick .obj or .bgeo, perhaps just to save a draft for easy sharing.

A much more robust option that I often use is File Cache. This is a great way to store the results of a complex node tree that might otherwise take a huge amount of time to recook constantly while working.

For example, say we wanted to start animating the vase we created earlier in this series, or maybe simulate it shattering. We could add a File Cache at the bottom of the node tree and save the current mesh state to disk. The magic of File Cache is that it also functions as a file loader. Once we save our work all we have to do is check Load from Disk and now it functions as a File node. If we decide to go back upstream and make some changes we could easily do so, click the Save to Disk button again, and have a fresh new cache to build upon.

File Cache also offers many convenience features such as auto-generated file names, versioning and saving in background. It's a great tool for streamlining work in large scenes. Highly recommended!

When it comes time to make final exports for sharing among apps or with clients, there are a number of ROP export nodes available. ROP stands for Render OPerator, which is the jargon Houdini uses to label its various contexts. There are SOPs, surface operators, DOPs, dynamics operator, etc. We've been working exclusively with geometry in /obj context, which has kept us in SOPs world.

If we press Tab and type ROP we'll see many options for "rendering" files to disk. There is a ROP Alembic Output, a ROP FBX Output and several more. For USD we'd use a USD Export. Each of these nodes provides a common set of parameters such as frame range and file name, plus many format-specific settings. Generally speaking, using the default settings is fine for most tasks, but as we've come to expect with Houdini there are many opportunities for customization to meet specific workflow needs.

There are also some export options available in the File > Export menu. There's no particular reason to use these, however; they're very limited compared to the export nodes.

Conclusion

In this article we covered many of the most common methods to get stuff into and out of Houdini. You should now be prepared to easily handle many different popular file formats in all sorts of scenarios. Have fun!

Files

Comments

No comments found for this post.