2
$\begingroup$

I've been confronted with quite an annoying problem lately. I'm working with a colleague on 3d models, thus we frequently need to pass the models from one computer to the other. Yet is so happens that when one of us exports the model, although its rotation is at 0,0,0, when the other opens it in its own Blender, there's a rotation of 90 in X and -0 in Y.

I've been searching on the internet and I have seen some posts complaining about that problem with FBX export to Unity. I have tried a couple of things such as this: How can I prevent blender from exporting fbx with-90 rotation on the x axis to unity? or this https://unity3d.college/2017/07/08/fix-bad-90-x-rotation-unity3d-blender/ but nothing seems to work.

More precisions: - we work only with obj and gltf, not fbx. - I've imported Suzanne on one computer, just exported it as an obj, and on the other computer there's the 90 rotation. If i import this model back on the PC from which it's been exported, there's the rotation as well. - For the same test, I have exported in GLTF. When I import the GLTF Suzan back on the PC which exported, there's no rotation visible in the Transform and Suzanne is correctly oriented. But when I import it on the other PC, there's still no rotation visible in Transform (except that Y is at 0 whe it was at 0 on Y on the other computer) BUT Suzanne is not oriented the same way in the viewport! It's totally confusing.

So there, basically I don't understand what's happening, I have exactly the same Blender versions on both the computers, I just would like to be sure that when I export an object from one computer, it can be rightly imported with the SAME axes and rotations on another computer.

Thanks for your help!

$\endgroup$
2
$\begingroup$

This happens when we don't set the 'forward' and 'up' directions properly when exporting and importing.

When you click export to .obj in blender, you will be shown a screen to select the name of the .obj and output folder. Along with it, on the left of the screen, you will find the settings for export (if you don't see this panel, press 'T'). In those settings, by default, you can find the forward and upward directions as shown below.

enter image description here

When exporting, these directions are supposed to be the directions of the 3D program from which we are exporting. In our case Blender itself. So set it as follows. Because in blender, Z is the up direction and Y is the forward direction.Why? Because of what Blender shows as front view and top view.

enter image description here

Similarly, when we are importing, these directions specify the up and forward directions of the 3D program, from which the .obj file is exported. In your case, its blender again. So set it again to Y Forward and Z up.

Now, you won't get any wrong transform values.

$\endgroup$
  • $\begingroup$ Hello both! Thanks for your answers. So yes indeed it was the right thing to do! Unfortunately the objects are meant to be exported on a software whose code is based on Unity. So if I change the import/ export axes, the object will not be imported correctly in the software. It seems to be little choice but configuring Blender so that the objects, even if they show a rotation when they are imported in blender, are imported correctly in the software. Anyway thank you for helping me solve that mystery :) $\endgroup$ – Popi Sep 3 '18 at 15:55
  • $\begingroup$ @Popi You should mark the answer as accepted if it worked for you. $\endgroup$ – dval Sep 3 '18 at 21:16
  • $\begingroup$ Sorry :) Doing it right now $\endgroup$ – Popi Sep 5 '18 at 7:25
1
$\begingroup$

Did you check the Forward and Up options on the left hand bottom of the import obj file open dialog? The default options are "-Z forward" and "Y Up".

$\endgroup$
0
$\begingroup$

there are some inconsitencies in the blender fbx exporter/unity fbx import path.

here's what I found after some digging. The three inconsistent behaviors of the FBX exporter depend on the blender scene state when you export/save the .blend file.

case 1: if there is one mesh in the scene, the fbx will be imported into unity with a -89.98 rotation in x. It will be rotated correctly when dragged into the hierarchy but will look incorrectly rotated 90 degrees in the inspector model preview (unity bug)

case 2: if there is are two objects in the scene (mesh and an empty, sibling to each other top level in the hieararchy), the fbx will be imported into unity and rotated correctly. there will be a new parent game object with a zero'd transform and both the two children (mesh and empty) will have an -89.98 x rotation on each. It will be rotated correctly when dragged into the hierarchy and look correctly rotated in the inspector model preview

case 3: if there are two objects in the scene but only one root (i.e. the mesh is parented under an empty) the root transform will get a -89.98 x rotation and the mesh will have a zero'd transform. It will be rotated correctly when dragged into the hierarchy but will look incorrectly rotated 90 degrees in the inspector model preview

essentially, it's a choice :
1) is the -90 degree rotation on the model itself? (one object) 2) is the -90 degree rotation on the model itselt and a dummy object with a zero'd parent? (multiple root objects)
3) is the -90 degree rotation on a parent with a zero'd rotation on the model itself? (single parented object)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.