x


Asset import from 3dsmax : rotation issue

Hello all,

A quick question. I've got a pre-fab that contains my 3D object that i created in max. In max the object sits at (0,0,1/2) and rotated (0,0,0), however, when Unity grabs hold on the auto-asset import, the model is rotated -90 degrees on the x axis in Unity, so it's like it's laying sideways / fallen over.

Is anyone aware of issues with rotations changing like such?

Can i create a pre-fab from instantiated objects in my level currently? So that it can manage to hold the rotation for a quick hack fix?

Thanks!

Bryan

more ▼

asked Mar 28 '10 at 10:12 PM

Bryan C gravatar image

Bryan C
40 2 2 3

(comments are locked)
10|3000 characters needed characters left

7 answers: sort voted first

Yeah. I also had that extremely aggravating problem, except I was importing from Blender. There are several ways to fix this. Yes, you can do a hack fix by creating a prefab of the object, where it sits in an empty gameobject, rotated correctly. Any scripts applied to the object, you then apply to the prefab instead. This will ensure correct rotation, and correct behavior - if you rotate it and leave it outside of a gameobject, the axes will be pointing in funny directions. Another fix is to import it to Blender, bake the animations, and export as an FBX. Also, check the import settings and make sure there are no automatic rotations applied on import. Hope this helps!

more ▼

answered Mar 28 '10 at 10:21 PM

e.bonneville gravatar image

e.bonneville
5.7k 100 116 165

Thanks. I actually found my transform.eulerAngles too and applied the rotation to the prefab. Strange thing is the pre-fab shows okay rotated when in Preview window, but instantiating they wont.

Right, so following for correct behavior on the first recommendation, just make sure that I'm applying the script actually to the prefab, and not the gameObj instead of the prefab?

Thanks for the help =)

Mar 28 '10 at 10:28 PM Bryan C

Yeah, if you put any scripts on the prefab that have anything to do with rotation, remember you rotated it 90 degrees, so anything you that you do to its rotation will be off by 90 degrees. Oh, and make sure your gameObj is directly in the center of the mesh, or else the rotations will still be off by however far your gameObj is from the mesh!

Mar 28 '10 at 10:38 PM e.bonneville

Also, if this answer works for you, be sure to vote it up so others in your situation will be able to find this (working) answer easier.

Mar 28 '10 at 10:40 PM e.bonneville
(comments are locked)
10|3000 characters needed characters left

There is a problem with the rotation when you import from max the x goes to 270 degrees . But the model is imported straight. It is an unnecessary Unity bug. If it comes by default on the side then apart from the bug there is a problem with your model. (At least with the latest fbx exporter available) here . To make sure that at least in max your model is correct. go to utilities and add resetXform then collapse the stack.

The old Skool way to resetxform in max (and Maya), is to create a cube at 0,0,0 -convert to poly - assign the same material with the model - attach your model - go to element mode select cube and delete. This way your pivot point will become the one of the deleted cube but you can do it with the xform utility too by moving the center and gizmo.

The game objects as elbon 96 said have 0,0,0 rotations so you can do your scripts there.

more ▼

answered Mar 29 '10 at 10:43 AM

alexnode gravatar image

alexnode
984 27 32 49

Okay cool. I tried the reset xform but still getting the rotation, so it looks like it's the unity bug. Thanks guys. I got it figured out pretty easily, just wanted to check out what others had exp'ed.

Mar 29 '10 at 10:33 PM Bryan C

It is very annoying, there are reports that it creates problems with physics and many problems if you try to put a child under your model because it will rotate, apart from that if you make a tree it will come on the side in the landscape tools. There are workarounds for each case, I think... but very time consuming if you don't know what to do in the first place (like me) . You can vote in the wish list for a fix on the FBX importer

Apr 01 '10 at 11:03 AM alexnode

And to be honest I think that 3DS MAX is not supported properly, I would like to see these problems in the MAX importer page before I start working on a project.

Apr 01 '10 at 11:05 AM alexnode

As alexnode pointed out, you can vote for this to be fixed in official Unity uservoice-service: http://feedback.unity3d.com/forums/15792-unity/suggestions/210672-fbximporter-correct-orientation-and-without-game

Jul 26 '10 at 07:17 AM Jukka Alander
(comments are locked)
10|3000 characters needed characters left

As said, all you need to do is adjust the pivot.

In 3DS Max, you need to make sure in pivot rotation that the green arrow points up.

Easiest way to do this is select object, goto pivot tab, select affect pivot only, reset pivot, rotate pivote by 90 around the x axis

more ▼

answered Aug 30 '11 at 06:24 AM

jlcnz gravatar image

jlcnz
16 1

This did it for me... Unity does a -90 degree rotation upon import on the X axis. HOWEVER, when painting grass, this seems to be ignored. So a pivot rotation is essential.

Sep 15 '12 at 07:56 PM Jordii
(comments are locked)
10|3000 characters needed characters left

First use the "box method" to reset object transforms in max and then center the object and adjust the location of the object axis. This ensures that you have no funky transforms applied to the object axis before the next step.

For any object in 3D Studio Max before exporting also: rotate the object axis about the x axis 90 degrees within Max so that x(the red axis)remains the same, the blue axis points along what would be unity's z,and the green axis now points downward. Again, red stays the same (pointing right), the blue along the z forward (into the screen from front view in max) and the green pointing down.

You're not done yet. Export FBX to unity. Within unity ensure that BOTH the object's game object folder and the mesh object have 0 rotations. Unity's rotation scheme is a work around for 3D Studio Max's unique coordinate system. After setting Unity to 0, you should have an object that is oriented properly without rotation transforms within unity.

I would guess that the fewer transforms Unity has to put on an object just to get it scaled and oriented properly for the app., the quicker the object will render, so this could have a performance boost to get your rotations worked out ahead of time?

This problem is more with Max than Unity and goes way way back.

I'm using an older version of Max and FBX converter. Perhaps this has been fixed.

more ▼

answered Sep 18 '10 at 04:33 PM

vertex gravatar image

vertex
105 13 13 15

(comments are locked)
10|3000 characters needed characters left

I tried to modify the pivot point as described here (http://x9productions.com/blog/?cat=3&lang=en_us&paged=4) but it strangely makes no difference, still it may work for others.

Max 2009 FBX 2009.3

I went with the empty game object method, for a quick fix it works a treat.

more ▼

answered Aug 30 '10 at 12:20 AM

Simon 5 gravatar image

Simon 5
2 3 3 3

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2166
x972
x454
x419
x335

asked: Mar 28 '10 at 10:12 PM

Seen: 10514 times

Last Updated: Sep 15 '12 at 07:56 PM