unity3d-jp / MeshSync

A package for synchronizing meshes/models editing in DCC tools into Unity in real time.
Other
1.55k stars 174 forks source link

Should MeshSync correct mesh to use Y-up on export? #67

Closed bitinn closed 4 years ago

bitinn commented 5 years ago

I am using MeshSync with Blender 2.8 and found that it decides to rotation gameobject instead of fixing the mesh coordinate (from Z-up to Y-up).

I think it's fine to keep the Z-up in scene view, but on "Export Mesh", I would say it's more appropriate to convert them into Y-up. Perhaps there should be a toggle to allow changing this behavior?

i-saint commented 5 years ago

thanks for the feedback.

actually, the previous version of MeshSync converted the coordinate of each vertex from Z-up to Y-up. I changed to current behavior to align FBX importer's behavior. (if you export a mesh from Blender as FBX and import it to Unity, you can confirm meshes are still Z-up and X angle of root GameObject is -90) but as you point, keep "per-vertex convert" mode as an option or add "export meshes with coordinate conversion" is a good idea. I will try.

bitinn commented 5 years ago

(if you export a mesh from Blender as FBX and import it to Unity, you can confirm meshes are still Z-up and X angle of root GameObject is -90)

Thx, I saw your release note.

But I am not certain about this behaviour, here is a quick test (using Blender 2.8, 2019-04-24 build):

FBX

Screen Shot 2019-04-27 at 18 15 41 Screen Shot 2019-04-27 at 18 13 58 Screen Shot 2019-04-27 at 18 16 53 Screen Shot 2019-04-27 at 18 16 39

OBJ

Screen Shot 2019-04-27 at 18 18 48 Screen Shot 2019-04-27 at 18 18 53 Screen Shot 2019-04-27 at 18 19 21 Screen Shot 2019-04-27 at 18 19 26

Comment

sasa42 commented 4 years ago

Hi. FYI. Here some good overview about some workarounds with an script to handle fbx export issues. https://youtu.be/bpH5ZfonExo

However when you need correct behaviour for all cases you need to convert Blenders right-handed (+Z up) to Unity’s left-handed (+Y up). Here is an Unity PostProcessor script who does it right for all cases in special for rotations. https://www.edy.es/dev/2014/02/a-better-blender-to-unity-3d-importer/

Features... “My script imports the Blender file into Unity 3D as expected:

Complete hierarchies are preserved with their correct transforms (position, rotation, scale). No artificial rotations are imposed in the imported model: if a rotation in Blender was [0,0,0] the rotation in Unity will be [0,0,0]. Optionally the forward orientation can be reversed for matching the Unity’s convention (+Z). Keyframe-based animations in Blender are correctly converted to animation clips in Unity. The animations will look the same in both Blender and Unity. ... “

Do you think same behaviour would be possible in live MeshSync doing all these quaternion operations in realtime?

i-saint commented 4 years ago

thanks for the feedback. as noted in https://github.com/unity3d-jp/MeshSync/issues/67#issuecomment-487268063, you can choose conversion algorithm on next version. it was already implemented in dev branch and working fine.

i-saint commented 4 years ago

https://github.com/unity3d-jp/MeshSync/releases/tag/20190902