MayaMaMbToUnityImportFails

The error reported in the console is:

mental ray for Maya 2011
mental ray: version 3.8.1.26, Feb 7 2010, revision 110437
Result: untitled
Warning: file: /ClientsLapTop/Clients/600_UnityDevelopment/TestMaya2011Unity/blobbly_001/Temp/FBXMayaMain.mel line 8: Plug-in, “fbxmaya.bundle”, is already loaded. Skipped.
Starting maya loading and fbx conversion
File read in 0 seconds.
Resetting export options to the default values.
Error: FBXConvertUnitString is now deprecated. Use FBXImportConvertUnitString or FBXExportConvertUnitString.
Maya quit prematurely
Maya couldn’t convert the mb file to an fbx file
Try exporting the mb file to an fbx file manually.
FBX plugins can be found here: FBX | Adaptable File Formats for 3D Animation Software | Autodesk

Yes using Maya exported FBX files works fine.
It is just that for some test etc. importing directly uses less steps.

Is there something I can do about this?

Because the error stated FBXConvertUnitString is now deprecated I when to:
/Applications/Unity/Unity.app/Contents/Tools/FBXMayaExport.mel.

In this script I searched for FBXConvertUnitString and replaced it with FBXExportConvertUnitString saved the script relaunched Unity and bingo! All is well.

A little thank you goes out to Adam Mechtley for pointing out where and why this MEL script exists. Inhis Complete Maya-Unity Workflow tute:
http://vimeo.com/10968593?hd=1

Because you are opening a Maya file with Unity…

…and current version of Unity will use an old version of the FBX plugins.
You probably installed a new version of the FBX plug-ins on Maya.

The error you got is a conflict of melscript function from the old version of the FBX plugins.

Now I continue to say that to open ma or mb file in Unity is a Joke.
You will have better scripting something in Maya to export to Unity. :wink:

This is incorrect.

If you read my second post I have actually fixed the problem by making the appropriate change to the Unity supplied MEL script.

uhuh :wink:

The explanation I gave to you should help you the next time. and my asnwer was correct.

A *.mel file is a script done for Maya.
Unity use it to convert you maya file to FPX and then to import it in Unity.

The “FBXExportConvertUnitString” and "FBXConvertUnitString " are melscript function for the FBX plugin.

You can found the full list fot the mel script function for the plugin in the FBX documentation from your install directory.

And…

If you go more far away than this 2 functions, you will find some very interesting things in the documentation it let you add more customized parameter when exporting in Unity.

For example to export Animation data only is I think only available from Melscript.

If you do not find the plugin in your program file directory, here is the online documentation :

Just remember if you have another error later with this mel file, just check the FBX documentation.
There are many function they changed of name since the 2.0 version of the plug in.

You can also read more here :

http://area.autodesk.com/forum/autodesk-fbx/fbx-plug-ins-import-export-discussions/

good luck :wink:

Maybe I just didn’t understand the wording to the first answer. Of course if the the error is talking about redundant code that refers to older versions of the plug-in.
My mistake was in reading it. It looked as though you were referring to my installed plug-ins being old which they aren’t.
Thanks for the extra references.

Can you expand on why you think direct importing of Maya into Unity is a joke?

I’ll chime in with my downside to using the direct importing of Maya files.

If you use the Maya files directly in the project, everyone who opens the project needs to have Maya installed, otherwise no importing of the files occurs.

I find it more convenient to export to FBX, and cheaper for the budget, as you don’t need to buy extra seats of Maya for say an engineer or a UI artist.

Valid points.

My being a solo developer.
They don’t affect me.

It is a few less steps.
I just drag the .mb out of the working Maya file structure into Unity’s.

If I am just testing things then I work on the Maya file directly from the Unity directory structure.

I like the instant update.

Yup!

Before exporting as FBX file I clean with melscript my scene, model etc…

then when I export my datas to unity I know the FBX is clean and will prevent of all bug we can get importing a full Maya scene with all the nodes, Riggings, instance, reference, dirty history, constraint, group, sub shape, nurbs stuff, curve, dirty timeline for the animation etc.

Imagine a FBX with model + bones + skin only.
Or else, a FBX with animation data only without model, or skeleton. ^_^!

Also remember a rigged model always use bones you do not need in game. Because you only need it in your rig for orientation business at the end of a bones hierarchy…

Look a the 2 following pictures :
Skeleton model Before and after…
I let you imagine the ugly tree I will get in Unity with the first one… and the cute tree with the second one.

Thanks for the time and effort in explaining what you meant.
I understand what you mean now and agree that a messy Maya file structure will give you a messy Unity file.

The file clean-up and strip-out that you suggest in your very detailed reply
is standard practice for my Maya work. As matter of workflow.

I constantly clean my Maya files while I work as well as at the end before using them for any kind of final rendering. Before any purpose not just importing to Unity.

Messy file structures cause problems within Maya let alone 3rd party apps.
For example Maya dynamics will totally freak.

It is an unfortunate cost for a nodal structure with history.

Thanks for your response and help.