Blender 2.8 Export FBX while keeping Collections Hierarchy

I realized when i export an FBX from 2.8, collection are not taken in consideration.
when i import an FBX to 2.8 from 2.79 group hierarchy are destroy.
which workflow will allow me to keep collection hierarchy while exporting an fbx from 2.8.
drag and drop mesh into an empty is not working as in 2.79.
thanks in advance for your help.

Is this a feature of FBX?

no is not and I’m asking how to do it, how to export an FBX in 2.8 and keep the collection hierarchy the same, like a group.

I have exactly the same question. Right now I’m using a script I created for this task:

import bpy

sCollection = bpy.context.collection

def parentCol(_colParent, _objParent):
    for col in _colParent.children:
        newObj = bpy.data.objects.new("empty", None)
        bpy.context.scene.collection.objects.link(newObj)
        newObj.name = col.name
        newObj.parent = _objParent
    
        if len(col.objects) > 0:
            objs = col.objects
            for obj in objs:
                obj.parent = newObj
        else:
            parentCol(col, newObj)
                
root = bpy.data.objects.new("empty", None)
bpy.context.scene.collection.objects.link(root)
root.name = sCollection.name

parentCol(sCollection, root)

The script translates the hierarchy of collections into a new structure with parented empties.

Is there another or better solution?

3 Likes

Highly unlikely, as Collections are a ‘blender only’ thing, and FBX is based on regular hierarchy setups that every 3d application will understand after import.

As a long time 3D artist I can only say Collections make sloppy workflow in this regard.
It’s like opening a 3DSMax file and see everything names box1… box 100, curve 1 … 50 etc.
No structure whatsoever on scene level itself.

I do understand the design philosophy behind it, but Collections are trying to do too much imho.
Personally I find the link between grouping things in Collections and using them for rendering as well
very annoying. I would rather have seen a split between them.
And the fact that you have to use Collections for linking objects is not my favorite option either.
It gives you twice the work if you want to do it in a proper way.

1 Like

I understand your frustration.

Personally, I find working with collections in the first place quite pleasant.

But I think, just like you, that Blender should be able to follow the industry standard at this point and allow a smooth exchange of data.

What about other formats? Is the hierarchy transferred in Gltf or USD?

In USD it is for sure, that’s one of the ‘perks’ of the format.
Gltf I 'm not sure, haven’t used that yet. But I bet it is, as it also supports animation.

1 Like

Continuing the discussion from Blender 2.8 Export FBX while keeping Collections Hierarchy:

Finally! THANK YOU!!! A NON-Destructive File export. Was getting mad to have 200+ parts FUSED after exporting. Blender needs a hiarchy overhaul.

Hey, this is great script, thanks for this, exactly what I was looking for.
One problem though, I’d like all the empties created to inherit the 3d cursor origin, which does not work for some reason. If the empty is created via bpy.data.objects.new, the origin automatically sets to the WORLD position. And I could not find a way to change the object origin after it is created. Even if I select the empty object and try to manually set origin to 3d cursor, it does not change. Is it a bug?

Hello. I’ve made an addon for Blender that help with preserving objects hierarchy with FBX.
The basic idea was to make a way to save Blender hierarchy to separate file so it can be then loaded in 3ds Max but actually you can save it and load it in another Blender project and it will work as well.

Addon:
Transfer collection hierarchy from Blender to 3ds Max (and back) - Blender Market