Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exporting group to Three.js from Blender in gltf format

Tags:

I have a Blender scene in which objects are organized into collections.

When I export the scene in gltf format and import it in my Three.js project there is no track of these collections.

What I expected was that for each collection correspond a group.

How can I get this result? Is it possible?

like image 541
zed87 Avatar asked Feb 05 '19 10:02

zed87


1 Answers

I think the most robust way may be to create one Empty object per collection in Blender, and use it as the parent of the rest of the contents of its collection. Give it a name that you'll be able to look up from the ThreeJS side.

In glTF there are no "collections" per se, but there is a parent/child hierarchy of nodes, and you can use that for grouping purposes.

As a side note, glTF does support multiple "scenes", but I don't recall if the exporter will write out multiple Blender scenes as such. Most glTF readers don't do a good job of reading that anyway. I suspect that using Empty nodes as parents of groups to organize things will be the more well-tested code path.

like image 138
emackey Avatar answered Sep 19 '22 11:09

emackey