miércoles, 15 de marzo de 2017

Unity Pivot Nightmares!

So, I think we are all familiar with pivot issues in Unity. I can Imagine how difficult it has to be, to make a standard way for 3D, when different programs have completely different system of coordinates.

We have two main issues by working with 3D

1st - Is the Universal problem between inches and the metric system. So, you get familiar with these numbers: 2.54 or 0.00254

¿What are those? The difference between inches and cm.

2nd - Is the problem between programs. Z is up or Y is up.. wich are the two most common, Y up is based on Autodesk Maya, and then, if you use 3Dsmax, you get Z up, and lots of problems with it. also if you use Blender, you will get similar problems

¿The answer?

How to achieve stuff out of 3Dsmax


My experience is... when you export FBX, every setting of units you write on scene are overwrited by the FBX export options, so, you just have to take care of FBX export options, and become an expert on that.



There you can achieve two things in Unity, file scale conversion on one or other part of Unity, one (the one wich comes from the program) is showing when you select an FBX at Unity, then the Scale Factor and File Scale can be 1:1 or 1:0.0254 (inches to meters) so, if I understood right, 3Dsmax uses inches, so you can se it to export on automatic or directly into inches.



If you try to get 1:1 from a FBX generated in 3Dsmax, then, you have the scale conversion on the objects at the scene, so, the transform - Scale value gets to 0.0254, wich will give you big problems.
I say this, because then, you have different scale conversions if you include parent-child relationship between meshes and helpers... and everything gets quite messy and difficult to understand, so... it is better to keep thing simple.


Your objective is to get 0.0.0. on you Transform and 1.1.1 on your scale values

Once you achieved 1.1.1 values on scale, then, you will encounter a problem with the rotation, wich will be resembled like -90 on X axis, and the Asset Store will be telling you the objects are not facing Z, what the... ? what? My objects are facing Z.. just they got this number.

So, what they mean, what they do.. is to reset all those values on the gear button at the top right of Transform values, then everything gets to zero, and the nightmare begins.

What to do?

The answer I got was, to get a Batch export script for 3dsmax, wich gives to you the option of exporting each object placed at 0.0.0 position, do the modifications you need, and reset these options to continue working on the meshes you were doing. So, I reset position and I have to rotate the object 90 degrees on X axis to avoid this 270 (-90) rotation of before. There you have an object with 0.0.0 rotation, but.. the problem is, now.. I have an object facing down.

Plus! To solve it totally you have to rotate the pivot on 3dsmax.. then, you have to rotate till it is like... this dummy I created... Imagine you are on Unity and you have to achieve these directions, then, you dont have much to do, rotate and batch export from the script.


I hope this solves the main issues you are having.. but I suppose this does not solve everything you could have doing an import, because sometimes are Unity bugs doing stuff into it. Like one related to include a point helper and parenting stuff into helpers... but that's quite complicated to explain.


https://docs.unity3d.com/Manual/HOWTO-importObject.html

https://docs.unity3d.com/Manual/HOWTO-ImportObjectMax.html

No hay comentarios:

Publicar un comentario