1
$\begingroup$

I am looking for a way to transfer the hierarchy of the collections from Blender to Unity. In other programs, like Cinema 4D, this works without any problems.

Is it possible to export a fbx-file with the hierarchy of the collections?

Currently I use a script that translates the structure into a new hierarchy.

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)
$\endgroup$
0
$\begingroup$

I'd love to understand if transforming parenting informations into collections should lead to possibility to batch export with Blender Function for FBX. While I'm not skilled with coding into blender, I'd love to resolve this issue to correctly export Groups and parents/children into Unreal Engine:

My idea:

My case example:

Object01 Object02 …

Need to Create Collection automatically and set the relative object inside:

Collection01\Object01_grp (and inherited objects) Collection02\Object02_grp (and inherited objects) …

Hope it could be possible…

$\endgroup$
1
  • $\begingroup$ This kind of response fits forums such as BlenderArtists. On BS Exchange answers need to be definite. $\endgroup$ Aug 31 '20 at 8:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.