Exporting sub-objects with customized pivot point

   4614   1   0
User Avatar
Member
1 posts
Joined: April 2019
Offline
So I'm working on a video game using destructible meshes in Unity. I do the destruction in Houdini and then import the baked immesh in Unity.

I am doing a houdini asset that can cut any mesh into into little parts that are their own objects.

I then export all the pieces as a single FBX and import it into Unity.

My problem is that when I render as FBX, all the parts share the same pivot point (which is the origin point in Houdini).

Is there a way to export a fbx in Houdini with sub-objects each having their own pivot points ?
Do you guys have any idea how I can do that ?

— what I do step by step is :

-Take any mesh
-cut it with several planes with random angles and position
-apply boolean fracture
-apply explode but keep its value to 0, the mesh is now several pieces
-hide every pieces but 1 using a blast node
-copy/paste the geometry node and change the visible part to the next piece, repeat as much time as you have pieces
-export all geo as a fbx group

-import into unity
-apply joint to all the object parts
-apply the breaking script, the one which needs all objects to have a centered pivot point

Note : the object appear whole in game but it's actually made of broken Seamlessly stuck together
User Avatar
Member
151 posts
Joined: June 2019
Offline
Hi!

First I think you should check this Labs tool: https://www.sidefx.com/tutorials/game-tools-rbd-to-fbx/ [www.sidefx.com] but it doesn't split geometry to separate objects. Instead it makes a skinned mesh ie one object with every piece attached to a bone. Pivot would be at the center of each piece.

If you want split the geometry manually check this great tutorial from indie-pixel: https://www.youtube.com/watch?v=WvEh1EI-X44 [www.youtube.com] It involves some scripting though but video covers pretty much everything about it. It's a good idea to learn a bit of python in Houdini as it will help you to automate all the manual work you do like copy-pasting pieces to separate geos (if you're not doing it already through scripts)

The only thing that in video pivot would be in the center of the original object. So it just helps to get rid of manual work.

I made another exporter myself for my project to split any geo by groups with pivot in the center of every group. I've attached a file with hda (it's embedded so you can use it separately). The idea is take any geo, split it by every group in it and save to fbx as group of objects.

Attachments:
group_to_fbx.hiplc (4.4 MB)

  • Quick Links