[Closed] How to set rotations to 0,0,0 for exporting in unity?
Hi all,
I would like to know if it’s possible to set the rotations of an object so that when importing in unity they are at 0,0,0.
I’m exporting in FBX
I tryed different solutions as:
- reset xform
- freeze rotation
- rotation to zero
- $.rotation = eulerangles 0 0 0
but when the programmer imports my fbx in unity he always says that the rotations are not at 0,0,0
Thanks
do you mean the button “transform” in the Reset group box of the Hierarchy > Pivot command panel?
I forgot to say that the programmer wants also that objects have the pivot with the Y up, which I do by hand, since the option in the fbx exporter does not seem to work.
With reset transform the pivot is back with the Z up
ps: I’m not a coder
what does he say they are ? are we talking [0.000001, 0.0000001, 0.0000001] or [0,-90,180] ?
the most of seem to be +/- 90, sometimes there are strange values with commas like
[4.577637e-05, -1.525879e-05, 0] or [-90, 1.525879e-05, 0]
I can ultimately turn the pivot by hand, but the problem are the rotations that change when I rotate the pivot
Yep, ResetTransform is the maxscript command.
There are examples on the forum how to set the Y up.
There are scripts that can turn the pivot for you.
The strange values means that they are closer to 0, so consider them as a 0.
Maybe you have to find a way to reset rotation in Unity.
What about if you create an object and then export it and import it in Unity? Is it still rotated?It must have 0,0,0 rotation in 3dsmax, so you don’t have to reset its rotation.
like suggested make sure the object in Max has had its xForm reset, and this would be easier to fix Unity side because of the differences between z up (Max) y up (Unity) it gives a -90 rotation on the gameobject, this can be fixed in the AssetPostPrcessor scripts in Unity to apply a matrix transform to the mesh when imported and then save the asset again.
hope that helps
Dave
I can even consider them as 0, but the programmer says they must be 0.0.0
I'm only a modeler in 3dds max, the programmer (unity) says that he can't set rotations to 0.0.0. in unity because otherwise the object changes position
Some days ago I tryed to export a simple cube and in unity it was rotated. In max the "rotate transform type-in" was 0.0.0
I already tryed to apply resetXform and collapse the stack, but the object in unity is rotated. The programmer want that my object has 0.0.0. and Y up when he import in unity. Is that possible or he has to fix my object?
another way if you creating prefabs is to make sure you objects are rotated -90 in max then reset xFom again, and export, assuming they are facing forward max viewport
When dropping in your fbx in Unity it will look wrong, just reset the rotations to 0,0,0 and it will look right, then when you create the prefab it will be how your programmer wants.
Its not a good workflow because it means you have to undo the rotation in Max to allow you to keep working on the file, i would suggest asking for the postProcessor script, it will be written once and then you have a good workflow and he has the fbx/prefab how he wants it
I don’t know if the programmer has to create prefabs (and I do not use unity), but I’ll try your solution only for see if it works correctly (because as you said it’s not a good workflow especially when you have many objects and some are grouped and with links) .
As I understand it the Postprocessor is a script that is executed automatically when you import the model in unity; Can you explain me what should make this script in this case?
Thanks