EdyJ / blender-to-unity-fbx-exporter

FBX exporter addon for Blender compatible with Unity's coordinate and scaling system.
MIT License
1.01k stars 105 forks source link

Preserving Collection Folder Structure #51

Closed ess4654 closed 3 months ago

ess4654 commented 3 months ago

If anyone else is having problems with how Blender exports the objects in the active scene. Specifically the nature that causes all organized objects in their collection folders to end up parented to a single game object when imported to Unity, I created a new feature for this tool to overcome that issue. Pull Reqest

EdyJ commented 3 months ago

Thank you for the contribution, but this feature is outside the scope of this add-on.

Collections in Blender are not 3D hierarchies. Collections are used to organize objects in hierarchical "categories" without affecting their 3D hierarchy.

For example, you may have a complex hierarchy of objects, and include any of the objects in this hierarchy to different collections. Then, enabling and disabling these collections allows to enable and disable those objects regardless their position in the hierarchy.

Using collections as 3D hierarchies is a misuse of the collections feature. Collections don't have a transformation matrix, and aren't related with the parents of the objects. Whenever there's a 3D hierarchy, there should be a 3D parent associated with proper transformation matrix, not a collection.

While there are some specific use cases where converting collections to hierarchies could make some sense, this is not a general rule. Doing this can produce many issues when a collection (without transformation matrix) is converted to an Empty object (with an arbitrarily assigned transformation matrix). This could mess up the hierarchical 3D object completely when complex hierarchies are mixed with collections. This add-on is not committed to support (nor resolve issues related with) these corner situations of collections being misused as hierarchical 3D elements.