Export 3dmodel glb in Blender with collection

Hi
I have made collections for different parts of my 3d model. I mean I separate room, kitchen, living room, bath and. …
But When I export all parts are in gltf. scene.children
But I need all of them in their group. I mean each collection one group
How Can I access them in three.js?

If you open the model in https://gltf-viewer.donmccurdy.com/ and then look at the JavaScript console you’ll see the three.js scene graph printed — does it have names corresponding to your Blender collections?

If you’re using R3F or another framework, that would be good to know, and might steer the solution in certain directions as well.

This is one group. But I expect one group that has some groups inside like collections in the blender. How Can I make this?

It looks like the collections are not in the exported file, so this would need to be adjusted in the export. If you’re using Blender 4.2 I think “Full Collection Hierarchy” would be the setting to enable:

Have you tried this option yourself? I tried but could not make it work, it always just exports all the meshes in one group like without this option enabled.

1 Like

I do not have this option
Screenshot 2024-09-05 at 11.33.11 AM

As @donmccurdy has mentioned, the functionality is available in Blender 4.2. I tried it in the latest version (4.2.1) and it did not work unfortunately.

1 Like

I just tried blender 4.2, with three r168 and I can see that the blender hierarchy was preserved.

image

Working example,

Exported from blender with this setting.

2 Likes

thanks.I have installed Blender new and nw I have scene graph.
I export with collections but they are not correct.
look at this in Blender

and this is what I see in three.js"

I need a group that has different groups

Make them children of an empty object instead of a collection in Blender and they will be exported as a group.
the empty object will be the parent and you will see it as Object3D in threejs.
It will works with any blender version

Do you mean finally, we have a scene that is a group that has some other groups?

Yes exactly
The scene is the first group and you will have others group (groupA for exemple) as children and meshs Can be children of the groupA

1 Like