Exporting FBX from Houdini with Color

April 17, 2019

Exporting From Houdini

FBX and Color Information

Exporting the Model

Using my balloon Houdini example from class, I was able to export the geometry using the Educational version (the Apprentice version does not allow exporting FBX, but you could export an OBJ for my purposes possibly). This was very straight forward, as you can just use File -> Export -> FBX in Houdini.

Since I was doing this for a class to use in a Snapchat filter (using LensStudio), I wanted to reduce the poly count a lot. I opened the FBX in Maya and used a basic Reduce to reduce the poly count a lot before exporting that for use in LensStudio.

While this was good enough to export the geometry, I could not get any of the color information to come with it. I originally exported out an OBJ and had the same issue, so I exported FBX in hopes it would keep the color information somehow, but this was not the case.

Exporting the Color Information

My first thought to get the color information out of Houdini (since the colors of my balloons were being created with color nodes assigned directly to the primitives) was to create a material or texture of some kind with the information. My first attempt was simply adding a PrincipleShader to the balloon and hoping that would hold on to the color data. While the material did come out with the FBX export, it still did not have the color information.

Next, I looked to the output channel of Houdini to see if there was something I could use there. This is where I came across the BakeTexture node. This node has a huge amount of options that I could not really get a hold of everything, but this ending up being a good starting point to my process. I could use a lot of the default settings, including the "Texture Format" UDIM. This format however, requires that there be UVs on the geometry, which mine did not.

Using this to determine my next step, I looked into how to create UVs for my model. This led me to the UVProject node. This node can actually create a UV map from your model. It has several settings to change the plane it projects onto and the projection method, but the defaults were all good enough for me. It created a simple rolled out horizontal texture of my balloon model with its current color information.

Now, with UVs I could go back to the BackTexture node. This allowed me to use the UDIM "Texture Format" now. The selections I used under Images - Main, were "Extract Image Planes" (with Extract Format of PNG) and "Surface Unlit Base Color (basecolor)". Basecolor ended up being the file I actually used in the end. Finally, I selected my balloon object as the "UV Object 1" and selected a path to output the file in "Output Picture 1", as well as setting the "Resolution" to 256 x 256. This gave me my PNG texture file.

Using the Model and Texture

When I placed the FBX model in LensStudio, it came with the PrincipledShader as a material naturally now. I placed my exported basecolor PNG texture file in as the base texture file for the PrincipledShader material and this got my colors onto the balloons. Since the models did not seem to be exporting perfectly true to form of the Houdini geometry, I am not completely sure how accurate the color information is to the Houdini version, but it looked similar enough for my purposes.

Comments

Popular posts from this blog

Online Multiplayer Networking Solution Tutorial Using Unity and Mirror - Tutorial by: Jason Weimann

Ori and the Blind Forest: Building in Unity