How can I export H16.5 rigged & animated character to FBX that is recognizable in Unity?

   5165   12   1
User Avatar
Member
19 posts
Joined: March 2016
Offline
Hello everyone, I'm new to Houdini 16.5 Rigging System but I'm charmed with it so I decided to use it as my primary animation tool. Recently I rigged a pig and do a very simple test animation whose keyframes are set to null controllers which control the bones, but when i tried to export it to fbx in Unity, no animation takes at all were recognized. I tried rop fbx and /out/filmboxfbx but none of them works. I've been searching for guides or tutorials for a long time but no luck. I guess maybe the reasons are below:

1. The keyframes were set to null controllers instead of bones;

2. No skin deformations were written.

How can I transfer these keyframes mentioned above to bones? And how can I bake animations to deformation information that can be recognized by Unity?

Maybe a newbie question, but any help & suggestions will be great appreciated!



Enclosed is my HIP and geos. Many Thanks
Image Not Found

Attachments:
PigTest.rar (2.0 MB)

User Avatar
Member
19 posts
Joined: March 2016
Offline
Could someone give a clue?
Edited by Terryjin_314 - Oct. 23, 2018 21:00:22
User Avatar
Member
147 posts
Joined: March 2014
Offline
Cannot open the rar file, it is corrupt or created with something else than Winrar?

We're looking into this as well atm, and could be a interesting discussion to have.

But normally (in Maya) you would export the (static) bones + geo as a separate file, and just the bones for the second file.
Be sure to ‘bake’ the animation on the bones export, so Unity knows what to do with it.
And yes, you should animated on the rig controllers, unless there's something really specific that needs animation on the bone directly.

After importing both files into Unity, you should see a animated character in the preview window when selecting the animation FBX.


For us the whole import geo and add a rig is still something of a struggle atm, mostly due to the ‘newness’ of things.

cheers!

rob
Edited by RobW - Oct. 24, 2018 04:01:17
Apprentice Attribute / Houdini 17.0.381 / GTX 970 - driver 411.63
User Avatar
Staff
3455 posts
Joined: July 2005
Offline
have a look at this script from friedasparagus:
https://www.sidefx.com/forum/topic/48366/?page=3#post-237567 [www.sidefx.com]

might give you some ideas
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
19 posts
Joined: March 2016
Offline
Oh Thank u RobW and goldfarb. Let me take a look at at the link given by glodfarb first~~
User Avatar
Member
19 posts
Joined: March 2016
Offline
RobW
Cannot open the rar file, it is corrupt or created with something else than Winrar?

We're looking into this as well atm, and could be a interesting discussion to have.

But normally (in Maya) you would export the (static) bones + geo as a separate file, and just the bones for the second file.
Be sure to ‘bake’ the animation on the bones export, so Unity knows what to do with it.
And yes, you should animated on the rig controllers, unless there's something really specific that needs animation on the bone directly.

After importing both files into Unity, you should see a animated character in the preview window when selecting the animation FBX.


For us the whole import geo and add a rig is still something of a struggle atm, mostly due to the ‘newness’ of things.

cheers!

rob

Thank u very much for ur suggestion! Yes, exactly in Maya the exporting pipeline runs as u say, and once animation is baked on bones it can be exported together with deformed geos as a singe FBX. I'll try baking first and do as u say to export 2 FBXes.

Now I'll re-upload my files, if it's convenient to u can u please take a look foe me once again?

Attachments:
PigAnimation_ExportTest.hip (8.4 MB)
Pig_Male_Body.obj (2.4 MB)
Pig_Eyes_L.obj (10.5 KB)
Pig_Eyes_R.obj (10.6 KB)
Pig_Penis.obj (161.9 KB)

User Avatar
Member
19 posts
Joined: March 2016
Offline
I tried the script from friedasparagus, but it seems that it requires certain name prefixes and suffixes while naming null controllers and bones….failed to fetch bone information from my rig. I have no knowledge of python so I'm not able to analyze what happened..

Attachments:
error01.JPG (157.2 KB)
error02.JPG (127.7 KB)
error03.JPG (118.1 KB)
error04.JPG (58.4 KB)

User Avatar
Member
19 posts
Joined: March 2016
Offline
Also, after I created a new shelf tool icon and hit edit, copy & pasted the codes of downloaded .shelf into it, it got a syntax error as well.
User Avatar
Staff
3455 posts
Joined: July 2005
Offline
put the .shelf tool in your $HOME/houdini17.0/toolbar directory
then in Houdini you should be able to add it to one of the existing shelf sets.
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
19 posts
Joined: March 2016
Offline
goldfarb
put the .shelf tool in your $HOME/houdini17.0/toolbar directory
then in Houdini you should be able to add it to one of the existing shelf sets.
Thank u very much Goldfarb! And also many thanks to @friedasparagus! the shelf tool works, and I've achieved partially success while exporting.

Speak in detail.

1. The FBX generated from the shadow_rig tool can be recognized by Unity now, and it's controller hierarchy is (I assume) correct. I compared it by another animated character FBX created in Maya and exported to Unity and happily see their hierarchies are the same.

2. Also, the animation take contained in this pig FBX, whose bones created in Houdini (recognized as controllers in Unity and have the right hierarchy) have keyframes that can be seen in Unity's Animation window (I made the bake constraints operation on all my bones before exporting).

But the geo still remains static, seems that the deforming information still cannot read by Unity.

I tried RobW's method of export 2 FBXes, one is static bone system together with geo, the other is merely the baked bone system. Anim takes of both also have keyframes, but both are static in Unity's animation preview window.

I also tried several operation combinations in the output node such as enable Force Skin Deform Export and Export Deforms as Vertex Caches, and several combinations among them, no luck. I've searching for all day but still cannot find a method for solving this last problem.

I tried import this FBX to Maya, all is ok. Seems Maya can read the FbxCacheExport correctly.

What shall I do next?
Edited by Terryjin_314 - Oct. 26, 2018 05:15:49

Attachments:
Partially success01.JPG (183.2 KB)
Partially success02.JPG (28.4 KB)
Partially success03.JPG (57.9 KB)
Partially success04.JPG (192.1 KB)
Shadowed Geo.JPG (32.6 KB)
Export node.JPG (86.4 KB)

User Avatar
Member
19 posts
Joined: March 2016
Offline
Could anyone give a further instruction?

Best Regards, TerryJin
User Avatar
Member
147 posts
Joined: March 2014
Offline
HI,

Just to ask the obvious, did you use the Unity nameformat for the static and animated bones FBX files?

So static+bones is e.g. pig.fbx, the animated bones FBX should be pig@nameofanimationcycle .fbx (see the @ inbetween?)

If you do pig.fbx and walk.fbx, it will not work, as Unity will see these files as separate entitites.

If you did, no idea atm what went wrong

rob
Edited by RobW - Nov. 1, 2018 11:57:14
Apprentice Attribute / Houdini 17.0.381 / GTX 970 - driver 411.63
User Avatar
Member
19 posts
Joined: March 2016
Offline
RobW
HI,

Just to ask the obvious, did you use the Unity nameformat for the static and animated bones FBX files?

So static+bones is e.g. pig.fbx, the animated bones FBX should be pig@nameofanimationcycle .fbx (see the @ inbetween?)

If you do pig.fbx and walk.fbx, it will not work, as Unity will see these files as separate entitites.

If you did, no idea atm what went wrong

rob

Thank u again RobW, after several day's keep testing everything possibly related, I've finally discovered what's the wrong with the exporting work.

I noticed that after the FBX was exported, Houdini automatically created a folder with _fpc suffix attached to its name, which contains a .mc file and a .xml file, approved to be a pack of point cache files. It can be recognized well by both Maya and Max. What's more, the bone system is also recognized by them, but within the exported FBX file, the deforming imformation of the model is based on this point cache file, but not the bone system - Seems the skin-based deformation is not supported by Houdini. Sadly, point cache animation is not supported officially by Unity now.

Seems that Houdini's deformation method is not skin-based like Maya and Max. I failed in this test work finally. Maybe I'm trying to do more than Houdini can do, or maybe Houdini animation is not designed for game engine and game developing pipelines, but I still wish in later version Houdini can support bone-and-skin based deformation in FBX exporting.

Thanks very much to everyone here who advised and instructed me!

Best Regards.

Terry Jin
Edited by Terryjin_314 - Nov. 8, 2018 03:04:36
  • Quick Links