EdyJ / blender-to-unity-fbx-exporter

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

Instanced collection child has extra 90 degrees of rotation in Unity #3

Closed Swahhillie closed 3 years ago

Swahhillie commented 4 years ago

Hello,

I noticed that the children of an instanced collection get an unneeded 90 degrees rotation over the X-axis. Clearing this childs rotation in unity gets me what I need.

blender-to-unity-fbx-exporter-repro.zip

EdyJ commented 4 years ago

I've checked this out and currently I can't see a clear way to fix it. It seems that the collection instances are exported as a new object in the hierarchy being the parent of the duplicated collection. The duplicated objects are renamed in a very specific way.

Applying the rotation fix requires converting the instance to actual objects before modifying the matrices. I can do that in the editor with Object > Apply > Make Instances Real, but then the collection object is removed and the content of the instanced collection is copied to the root of the current collection and renamed in a different way (adding .001 etc to the names). In that situation the fix would work, but the exported hierarchy would be quite different than using the default FBX exporter.

I'm not sure about what to do. Maybe I could re-create the collection instance as Empty object, then make it the parent of the duplicated collection content. But again, the names would be different than those assigned with the default FBX exporter.

EdyJ commented 3 years ago

I can't find a way to solve this properly, so I'm closing this issue for now. It has been added as known issue in the readme.

Feel free to comment if you can provide further information or suggestions on resolving the problem.