Page MenuHome

Added support for exporting FBX LodGroup (UE4)
ClosedPublic

Authored by Pavel Křupala (pavelkrupala) on Oct 7 2016, 6:40 PM.

Details

Summary

I went through 30 fbx files exported from Maya2017, Max15-17 and Blender with Unreal Engine 4 so it can import automatically LODs in one single FBX file. I found out that all that is max/maya doing is exporting lods parented to one single empty object which has in FBX a type defined as "LODGroup"... so I changed the fbx bin export script you made and got it to work fluently. Now any1 can export 1 fbx file with all lods they want and I added only 3 lines of code.

If any questions arise, pls feel free to contact me on pavel.krupala@gmail.com

Here is a simple video showing/describing the process:
https://www.youtube.com/watch?v=GpoFagTcmOI

Diff Detail

Event Timeline

Pavel Křupala (pavelkrupala) retitled this revision from to Added support for exporting FBX LodGroup (UE4).
Pavel Křupala (pavelkrupala) updated this object.
Pavel Křupala (pavelkrupala) set the repository for this revision to rBA Blender Add-ons.

updated the spacing / tabs to be correct (sorry ctrl+c ctrl+v messed up)

Bastien Montagne (mont29) requested changes to this revision.Oct 8 2016, 3:40 PM
Bastien Montagne (mont29) edited edge metadata.

Change is indeed rather simple… But this feature is not 'blender native', and imho using the empty's name as check to enable it is awfully weak.

What about rather checking for a specific custom property of the object, like 'FBX_LodGroup', and if set to true, define it as 'LodGroup' type?

This would also give nicer way to keep that info across import/export in Blender (since FBX importer could easily define that property too when it finds a 'LodGroup' object).

This revision now requires changes to proceed.Oct 8 2016, 3:40 PM

sounds ok to me... but I need some time to figure it out how to script it :)

Pavel Křupala (pavelkrupala) edited edge metadata.
Pavel Křupala (pavelkrupala) removed rBA Blender Add-ons as the repository for this revision.

So here is the change. No depending on empty's name, but checking custom params for "fbx_type" which you can set to whatever you want. If not found, the default "Null" value is used.
Tested in UE4 and "fbx_type" with value "LodGroup" correctly exports meshes in a lod group and UE4 takes them in.

I hope I understood you correctly. :)

This revision now requires changes to proceed.Oct 27 2017, 3:06 PM
Kyle Gallagher (slaterbbx) accepted this revision.EditedOct 27 2017, 7:28 PM

Please add this Bastian, It works perfectly and saves a ton of time for us Game devs.

I think the current method of setting "fbx_type" as the key and setting LodGroup is the best method, this way it can be used to add any string you want to an empty thus being useful for more than one purpose.

Thanks, LGTM (aside from simplification noted in comment below), will commit.

io_scene_fbx/export_fbx_bin.py
563–566

simpler to do:

val = empty.bdata.get('fbx_type', None)
if isinstance(val, str):
    fbx_element_type = val.encode()
This revision is now accepted and ready to land.Oct 31 2017, 4:24 PM