Export instanced geometry with FBX

   9454   8   1
User Avatar
Member
15 posts
Joined: June 2016
Offline
Hi there,

according to the Houdini FBX documentation (http://www.sidefx.com/docs/houdini/io/fbx.html) the export function supports instances. If I export via FBX ROP and open the file in Modo or Unity, the instances are gone though and have been converted to unique mesh items.

Since FBX itself supports instances (see http://autode.sk/2Ebvr7F) and because of the above Houdini document I expected that instanced geometry will be carried through. It's not. Modo-Modo or Modo-Unity work in this regard btw.

On the Houdini side: The setup for instancing I'm using is working for alembic. Just not for FBX. If anyone wants to give it a try, I have attached a minimal example hip.

EDIT: Changed URL of documentation link
Edited by rayfoundry - Feb. 8, 2018 11:01:55

Attachments:
instanceToFbx.hiplc (170.3 KB)

User Avatar
Member
2536 posts
Joined: June 2008
Offline
My take on reading the Houdini help is that instance will be exported as meshes, and not ignored or exported as empty nulls.

I have never heard of FBX supporting instances because instances are supported by the app that reads in or renders the FBX.

Can you post the FBX file that you exported from Modo that contains instances? What happens when you import that into Houdini? Do you get instances or meshes?
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
15 posts
Joined: June 2016
Offline
Enivob
My take on reading the Houdini help is that instance will be exported as meshes, and not ignored or exported as empty nulls.

I have never heard of FBX supporting instances because instances are supported by the app that reads in or renders the FBX.

Can you post the FBX file that you exported from Modo that contains instances? What happens when you import that into Houdini? Do you get instances or meshes?

FBX does support mesh instances. It's described in the above link and it works in many DCC apps and game engines.
Edited by rayfoundry - Feb. 8, 2018 10:20:19

Attachments:
instance_test_layer_export.lxo (22.4 KB)
instance_test_layer_export.fbx (70.5 KB)

User Avatar
Member
2536 posts
Joined: June 2008
Offline
Thanks for the link, I can see that now.

I imported your FBX using Blender and Houdini and they both bring in all three cubes as meshes. I also kicked out an Alembic version from your supplied file. When I import it back into Houdini it does not use instancing. Alembics are stored as packed primitives, that is why they take up only 1 point.

If I dig deeper into the FBX import I can see that the File node references the Mesh using an index (.fbx#Mesh (2)). When I export the FBX in ASCII mode I can review what is stored inside the file. I am no expert but I do only see 1 set of vertices for the entire export. This implies to me that the instancing is being written to the file correctly from Houdini. If it were not an instance, there would be a set of vertices stored in the file for each cube.

You are correct that the Houdini FBX importer is not constructing instances when detected inside the FBX, but the exporter does seem to create them. Contact support@sidefx.com to report the bug.(reference this thread)

Can you export FBX from Modo in ASCII mode? Maybe compare each ASCII export in a text editor.
Edited by Enivob - Feb. 8, 2018 13:08:37
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
15 posts
Joined: June 2016
Offline
Enivob
I imported your FBX using Blender and Houdini and they both bring in all three cubes as meshes.

Thanks for your effort, but I'm trying to export instances via FBX Instance Mesh feature to Unity (which also supports FBX Mesh Instances). The roundtrip Houdini-FBX-Houdini is not required and the the Houdini FBX documentation does only state “Instancing” support for export, not import. So the behaviour you describe is expected.

Enivob
If I dig deeper into the FBX import I can see that the File node references the Mesh using an index (.fbx#Mesh (2)). When I export the FBX in ASCII mode I can review what is stored inside the file. I am no expert but I do only see 1 set of vertices for the entire export. This implies to me that the instancing is being written to the file correctly from Houdini. If it were not an instance, there would be a set of vertices stored in the file for each cube.

Again you shouldn't focus on roundtripping Houdini. The provided FBX file (generated in Modo) does get instanced in Unity. (3 prefabs with references to the same mesh get imported).

Enivob
You are correct that the Houdini FBX importer is not constructing instances when detected inside the FBX, but the exporter does seem to create them. Contact support@sidefx.com to report the bug.(reference this thread)

Will do, but regarding export. AFAIK import of Instance Meshes from FBX to Houdini is not supported. (See http://www.sidefx.com/docs/houdini/io/fbx.html)

Enivob
Can you export FBX from Modo in ASCII mode? Maybe compare each ASCII export in a text editor.
Sure, I've attached the FBX as ASCII. One Geometry is defined in it's ASCII text with three Meshes referencing it.
Edited by rayfoundry - Feb. 9, 2018 03:50:28

Attachments:
instance_test_layer_export_ascii.fbx (29.6 KB)

User Avatar
Member
15 posts
Joined: June 2016
Offline
I just realized that there's a new version of Houdini available which changes some FBX handling. It does not solve the issue though. But they open sourced the FBX importer. https://github.com/sideeffects/HoudiniFBX [github.com]
User Avatar
Member
15 posts
Joined: June 2016
Offline
Talking to myself in this topic

I've created an issue in the FBXExport repo on github which has been open sourced recently:Issue Link [github.com]

Can someone with experience with C++ have a look there and specifically on line 529 of the ROP_FBXDerivedActions.C file?

The comment there says something about not beeing able to copy attributes with FBX, but the FBX SDK docs [autode.sk]state that it's possible with lTargetMesh->Copy(lSourceMesh) for example.

For those in doubt why this functionality could be awesome: It would reduce files sizes considerably depending on the scene structure and most important, it would allow easy GPU instancing of meshes (think trees etc.) without the need to post-process the assets in the game engine (to de-duplicate same meshes).
Edited by rayfoundry - Feb. 10, 2018 15:44:25
User Avatar
Member
129 posts
Joined: Oct. 2020
Offline
found any solution yet? I want to export Animated AND Instanced glass shards from an RBD sim to blender. managed to solve the animations part but I fail on instancing
https://www.youtube.com/channel/UC4NQi8wpYUbR9wLolfHrZVA [www.youtube.com]
User Avatar
Member
833 posts
Joined: Jan. 2018
Offline
Pretty sure Alembic supports instancing. Could you use that instead?
>>Kays
For my Houdini tutorials and more visit:
https://www.youtube.com/c/RightBrainedTutorials [www.youtube.com]
  • Quick Links