Greetings all! I build one of these simple MEL scripts for each engine I work with (Unreal3, Torque, Source, Unity) so all artists on the project work with consistent grid setting and we don't end up with assets that don't match in scale. My team and students swear by these scripts so I thought I'd share it here.
I'm a game artist who makes no claim at being a programmer so let me know if you have any problems with the script.
I've struggled with scaling during the FBX import process into Unity since I started using Unity a few weeks ago but I have a system that now works for me. I'll post it here because I know some people are still having some issues with scaling between Unity and Maya:
The FBX exporter checks to see what our settings are in Maya and changes the settings scale Factor to equal 1.0 based on what your settings are. Unity 2.5 likes to set the FBX scale factor to 0.01 (why?) and will change the transform scale to compensate (this can be bad). The goal is to set the FBX exporter/importer settings to properly scale the units as opposed to setting the transform scale which can affect performance.
If you work in Meters in Maya and want them to equal Meters in Unity (I RECOMMEND THIS ONE):
1. Set Maya's Linear Working units to be meters.
2. Work in Maya as if 1 Unit = 1 Meter
3. On export set FBX Exporter -> Units -> Scale Factor: 100.0 (Centimeters)
4. Leave the Unity Inspector at FBX Importer -> Meshes -> Scale Factor 0.01
5. A 1x1x1 cube should drop into a Unity scene as 1x1x1 meter with a clean 1x1x1 scale transform
If you work in Centimeters as "generic units" in Maya and want them to equal meters in Unity:
1. Set Maya's Linear Working units to be centimeters.
2. Work in Maya as if 1 Unit = 1 Meter
3. On export set FBX Exporter -> Units -> Scale Factor: 1.0 (Centimeters)
4. In Unity Inspector set FBX Importer -> Meshes -> Scale Factor in Unity to be 1.0.
5. A 1x1x1 cube should load into Unity as 1x1x1 meter with a clean 1x1x1 scale transform
If you work in Centimeters in Maya and want them to equal centimeters in Unity:
1. Set Maya's Linear Working units to be centimeters.
2. Work in Maya as if 1 Unit = 1 Centimeter (1m = 100cm)
3. On export set FBX Exporter -> Units -> Scale Factor: 1.0 (Centimeter)
4. Leave the Unity Inspector at FBX Importer -> Meshes -> Scale Factor 0.01
5. A 1x1x1 cube should load into Unity as 1x1x1 centimeters with a clean 1x1x1 scale transform
I've been super impressed with the level of support and help available on this forum. I hope this helps someone. Please let me know of any inaccuracies in this post, thanks!
Edit: 6/26/09. Just updated with a fix for the clipping planes in default ortho cams. Whoops! I just accidentally deleted the attachment! It had been downloaded 35 times.ops:
Edit: 7/13/2010.
Updated to work in Maya 2011:
Changed color scheme a bit for the new UI
Fixed a few bugs with m/cm switch
Removed the MacOS version (had been downloaded 212 times)-- this one should work for all Maya platforms.
Please get back to me with any bugs.
Edit: 7/14/2010
* Fixed a bug that wouldn't allow it to work in previous versions of Maya. Now tested in Maya 2009 up to 2011.
* Changed some of the buttons to radio buttons for better feedback.
!! Removed the DL link from the Unity forums (had been downloaded 329 times) -- it's too hard to keep updated with my other sites.
This script (jbUnityGrid), along with others should now be downloaded directly from my website:
http://cgartistry.com/experimentation/melScripting.html
FINAL EDIT: This script is no longer available. A new version can be found here: http://forum.unity3d.com/threads/116...983#post774983



ops:
Reply With Quote

