FBX Export Groups / Primitives as Separate Objects

   19368   14   3
User Avatar
Member
4 posts
Joined: March 2018
Offline
Hi,

I'm quite new to Houdini and loving it. I have been using the GameDev tools and they're excellent. However, one thing I'm struggling with is this:

If I use GOZ (Zbrush) or import an FBX with polygon meshes in that are separate ‘objects’ in the FBX sense of the word (subtools in Zbrush speak), I can manipulate those ‘primitives’ as groups. However, when I use the ROP FBX Output node the geometry is all packed in to one FBX object. So for example, if I want one part of a mesh to stay separate so it can be animated in another package (have its own transform values) I can't use the Houdini FBX export because the geo is all one object.

Is there any advice anyone can give on how to keep my groups as separate FBX objects but in the same FBX file when I export from Houdini?

Many thanks!
User Avatar
Member
4 posts
Joined: March 2018
Offline
I'd love to know the answer to this one as well!
User Avatar
Member
20 posts
Joined: Sept. 2012
Offline
I would like to know that as well.
User Avatar
Member
2 posts
Joined: June 2016
Offline
I think I figured out a sort-of workaround for this. You need to go via the Alembic output, which as an option to build the object hierarchy from a string attribute. What you need to do is the following:

1. Set up a string attribute on the primitive level. This string defines the path in the output file that the primitive will be placed in.
2. Create an Alembic output node. Doesn't matter if this is a ROP in the SOP context or the output context.
3. Turn on “Build hierarchy from attribute” and point it to the string attribute you set up in step 1.
4. Export.
5. Import the Alembic file and re-export it as FBX. This FBX export will preserve the attribute-driven hierarchy created.

See the attached screenshots. As you can see in the modo screenshot, the object names are preserved. Forward slashes means it creates a hierarchy of nulls. These nulls are presumably at world origin, so it might be difficult to use this for animation.

Attachments:
Screen Shot 2019-06-27 at 09.35.27.png (3.4 MB)
Screen Shot 2019-06-27 at 09.35.14.png (3.4 MB)
Screen Shot 2019-06-27 at 09.35.37.png (1.2 MB)

User Avatar
Member
32 posts
Joined: Sept. 2017
Offline
I don't think this workaround solves the problem of being able to export FBX from Houdini and maintain separate meshes in a single FBX file.

Good to know that you can do that with Alembic though.

I just figured this out - if you are at the sop context, you need to create an objnet. Inside the objnet, you create a geo node for each piece that you want to be in a separate sub mesh. This is easily done with Python if you have an exporter for destruction pieces or something.

Then create a ROP net with filmboxfbx node and in the startnode/Export field, point to the objnet node.
You can uncheck the “Create Root for Subnet” checkbox if you do not want the separate meshes in group node and instead let the meshes be in the root of the hierarchy.

Here is the visual explanation:

Edited by akesso - July 8, 2019 18:13:06

Attachments:
fbxExportSubmeshes.jpg (386.5 KB)
fbxExportSubmeshes_inMaya.jpg (144.2 KB)

User Avatar
Member
14 posts
Joined: April 2018
Offline
I was having a similar thing of wanting to export thing as separate groups, as well as have an object that already has separate groups, be imported and maintain them being separated. Good to know there's a way to have them exported separately.
User Avatar
Member
28 posts
Joined: April 2016
Offline
If it is divided into 200 pieces, make 200 geo nodes?
Is there any solution? It is hard to believe that
the magic tool houdini cannot export fbx properly :/
User Avatar
Member
8506 posts
Joined: July 2007
Offline
xopowoo
If it is divided into 200 pieces, make 200 geo nodes?
Is there any solution? It is hard to believe that
the magic tool houdini cannot export fbx properly :/
is it any different in Maya for example? Can you export single Shape node as multiple objects?
geo level is the same as a single Shape node in Maya, simply geometry of a single object
hierarchy of objects with transforms exports to fbx as hierarchy of objects with transforms, I'd call that properly

but on top of that you have option to export complex hierarchies into .abc or .usd directly from geo level
Edited by tamte - March 18, 2020 02:34:43
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Member
8 posts
Joined: Sept. 2019
Offline
If you want to export from Geometry level you need to enable Hierarchy Path in ROP_FBX.
That means we need to have that "path" Attribute on Primitives been created.
As variant A, use Asseble SOP to do the job



But I prefer B => manual creation of that path attribute.



And to get nice looking semi automated paths, in Attribute Create for String I use expression `opname('..') + '/' + opinput('.', 0)` to combine Object name and Previous Node Name.
In FBX ROP I use $HIP/`opname("..")`.fbx to export in same directory as my project file and name it as Object Named
Edited by kodbitz - Jan. 14, 2021 00:47:50

Attachments:
houdini_export_v1.jpg (291.2 KB)
houdini_export_v2.jpg (314.9 KB)

User Avatar
Member
8 posts
Joined: Oct. 2020
Offline
Is it possible to define the type of an fbx node in the path? For example, if you want some level to act as a LODGroup (FbxLODGroup) can this be somehow specified in the path string?
Edited by Hamster3001 - Feb. 19, 2021 16:45:34
User Avatar
Member
10 posts
Joined: April 2016
Offline
I just came here searching for exactly this;
I'm scattering modules of cliffs to form larger cliffs around on a map. There's about 500 total.

Will either of the methods above export the mesh with the orientation/rotation and scale of the object as seen in the viewport? Meaning; the cliff objects are rotated to follow the normal of the terrain plus a little random variation in both scale and rotation.

In the game engine I make maps for I can't import a huge mesh like this but would have to export temp objects (like a plane or so) and replace them with the actual model I'm supposed to use. If the data for rotation and scale is intact, that's all I need!
User Avatar
Member
134 posts
Joined: Dec. 2006
Offline
OlaHaldor
I just came here searching for exactly this;
I'm scattering modules of cliffs to form larger cliffs around on a map. There's about 500 total.

Will either of the methods above export the mesh with the orientation/rotation and scale of the object as seen in the viewport? Meaning; the cliff objects are rotated to follow the normal of the terrain plus a little random variation in both scale and rotation.

In the game engine I make maps for I can't import a huge mesh like this but would have to export temp objects (like a plane or so) and replace them with the actual model I'm supposed to use. If the data for rotation and scale is intact, that's all I need!

If you are using unreal, you can create a HDA of your layout, then copy the path from the object in unreal and add it as a parameter to the points that you want to instance your geo onto.

So in unreal you import the static mesh pieces you want to instance, then you right click on the static mesh and copy its path. you can then paste that in houdini using the {s@unreal_instance = "paste the path from unreal"} in a point wrangle on the point cloud you want to copy the instances onto

you will also have to create a orient and scale attrib for the rotation and scale of the pieces.
Edited by willh - May 4, 2023 12:06:17
User Avatar
Member
134 posts
Joined: Dec. 2006
Offline
here is the setup im currently using, it works pretty well. Everything is instanced in unreal without me having to do anything except click build in unreal on the hda

Attachments:
instance_pointcloud.jpg (129.0 KB)
instance.jpg (122.6 KB)
instanced_meshes.jpg (113.5 KB)
unreal_instance_attrib.jpg (444.4 KB)

User Avatar
Member
10 posts
Joined: April 2016
Offline
I'm not using Unreal.
I figured I could export as alembic, and that does all I need! Perfect!
User Avatar
Member
2 posts
Joined: July 2014
Offline
This is the way. Thank you!

kodbitz
If you want to export from Geometry level you need to enable Hierarchy Path in ROP_FBX.
That means we need to have that "path" Attribute on Primitives been created.
As variant A, use Asseble SOP to do the job
Image Not Found



But I prefer B => manual creation of that path attribute.
Image Not Found



And to get nice looking semi automated paths, in Attribute Create for String I use expression `opname('..') + '/' + opinput('.', 0)` to combine Object name and Previous Node Name.
In FBX ROP I use $HIP/`opname("..")`.fbx to export in same directory as my project file and name it as Object Named
  • Quick Links