team stuck on mars
Pipeline from Maya to Unity
Why this topic?
Unity is classiﬁed as a game engine, the technology that drives the game. Games are assembled by using Unity. 3D modelers and Unity work
together to form games, whereas 3d modelers create 3D assets and Unity assembles it together. Unity is ﬂexible and accessible, and has become a
very popular engine use amongst game makers, especially indie games. Indie games are games made by an individual, say as a hobby or of interest.
3D modelers are used in a variety of industries. In this case, we chose to utilize Maya, because we identify it as a powerful software to work unity in
great games. What we see to be most advantageous with Maya is in the technology it has in exporting assets to be used within Unity.
With both Maya and Unity being both a very powerful tool, we wish to investigate in this presentation the pipeline process in which models are
exported from Maya and imported into Unity"
Some well known games such as Unchartered 2, Assassin's Creed, and Fable 2, all used the tools provided by Autodesk: the Autodesk Entertainment
Creation Suites which offers Maya/ 3ds Maya, MotionBuilder and Mudbox; an all-in-one package provided for game designers to explore creative
MAYA & UNITY
Unity allows users to directly import Maya ﬁles. Users can simply place .mb (or .ma) ﬁle in Unity’s project Assets folder.
The scene export from Maya will then automatically imported and show up in the Project view when users open Unity. By
exporting .mb ﬁle directly into Unity, the application would also import the following elements from Maya automatically to
beneﬁt the users to build their works:
1. All nodes with position, rotation and scale. Pivot points and Names are also imported.
2. Meshes with vertex colors, normals and up to 2 UV sets.
3. Materials with Texture and diffuse color. Multiple materials per mesh.
4. Animations FK & IK
5. Bone-based animations (Does not support blend shape)
However, in order to import Maya .mb and .ma ﬁles, you need to have Maya installed on the machine you are using Unity
to import the .mb/.ma ﬁle. OTHERWISE, you will have to export as an alternative ﬁle format if you are using different
machines for Maya and Unity.
And this is because that Unity is attempting to make the whole import/export process simpler by performing many
conversion jobs behind the scene. Once the .mb ﬁle is dropped in to its Assets folder, Unity will trigger a render application
from Maya in the background and begin the converting from .mb ﬁle into .fbx format, which Unity can then read.
MB V.S. FBX
There are few reasons for why we prefer manually export/import .fbx ﬁle rather than automatic export/import process
of involving other ﬁle formats such as .mb by Unity:
- Compatibility problem: When Unity process conversion via the 3D software (eg. Maya), the version of exporting FBX
is unknown. And this create a compatibility problem if the current version of Unity would support the FBX ﬁle (eg. FBX
2010 and FBX 2011) that it transferred from other 3D software format.
- By manually exporting as .fbx ﬁle from Maya, all the necesssary textures can be embedded with the ﬁle. Once the ﬁle
has been unpacked in Unity, the system will create a sister folder where it includes all the relevant textures. This
means that automatically, all the textures involved in a particular Maya scene are
organized. The organization will beneﬁt the users to ﬁnd assets much easier in Unity.
- By running the automatic converting process, when it crashes, users will face a difﬁculty to troubleshoot the problem
since they are unable to know if the crashing is happened on export from the 3D software (eg. Maya) or on import into
ASSET EXPORTING: OBJ or FBX
Understanding that .mb or the default Maya scene ﬁle is not the best ﬁle format to import into Unity, we are now going to
look at 2 alternative ﬁle formats that are possibly more suited for this task. The one that was previously discussed is .FBX
but how about another universally accepted ﬁle format .OBJ.
Both of these ﬁle formats focuses on Interoperability
Interoperability – ability of diverse systems to work together
OBJ – technology developed by Wavefront Technologies
Simple data format that represents 3D geometry
List structure to reference vertices, normal, UVs and faces
Hence very universally accepted format because of its simple structure
FBX – technology and ﬁle format owned and developed by Autodesk
Originated as ﬁle format for Kaydara’s FiLMBOX software
Focus on storing of motion data of object based model
Born in 1996, FBX is abbreviation for the FiLMBOX product
Kaydara acquired by Alias, Alias then acquired by Autodesk
Provide interoperability between Autodesk products and other Digital Content Creation applications
Epic Unreal Engine 3, Unity, Microsoft XNA
OBJ v.s. FBX: Which is better
Mesh only ﬁle format because of its very simple ﬁle structure
Materials that deﬁne its visual aspect stored in external .mtl ﬁles
Material Template Library (MTL) is a standard deﬁned by Wavefront Technologies
Deﬁne light reﬂecting properties using Phong reﬂection model
Outdated as it does not fully support specular maps and parallax map
Need custom MTL ﬁle generator
Emphasize on seamless transfer, more data retained, workﬂow efﬁciency
Animation, skinning, materials are all retained within the FBX ﬁle
Also has free C++ software development kit that can be integrated into custom software application
Customize information within FBX, convert data structure etc.
Testimonial: Frédéric Chappart, technical art director, Eidos-Montreal
Uses Autodesk® FBX® asset exchange technology
Worked with Autodesk Maya in the beginning
But want to take advantage of 3ds Max and Motion Builder
With FBX, they ﬂexibility to switch softwares, create new models, textures, lighting, within memory limits
tutorial of exporting FBX from Maya
1. Open your scene ﬁle in Maya.
2. Choose Edit > Delete All by Type > History to delete all history in the scene.
3. Delete all unused materials - Open the Hypershade (Windows > Rendering > Editors > Hypershade). Within
Hypershade, choose Edit > Delete Unused Nodee.
4. Check the orphaned nodes and naming - Open the Outliner and make sure all the elements are accounted for in the
scene. Also, make sure all the names are reasonable to cause confusion.
5. In Maya, choose File > Export All (Option Box)
6. In the Export All dialog box, change the Files of type: drop-down menu to FBX export. Click Save and Close
7. In Maya, choose File > Export All. In the Option section, expand the File Type Speciﬁc Options, then the Include
section, and ﬁnally the Embed Media. Check the Embed Media option.
8. Still in the Export All dialog box, expand the Advanced Options and the FBX File Format options within. In the
Version drop-down menu choose FBX 2010.
9. Give a name to the FBX ﬁle and press Export All.
10. The FBX ﬁle is now created and ready to be imported into Unity. Drag it into the Asset folder of your Unity project.
Things to be aware of
- Normals of certain objects could be reversed
- Happens quite often during building phase in Maya
- Simple to ﬁx. Go back into Maya, select the problem geometry and go to Polygons --> Normals --> Reverse.
- Colliders are used to register collisions within Unity
- Mesh colliders will be the exact shape of the polygon mesh
- Simple to make, but too many mesh colliders will drop frame rate of game
- For better optimization, create basic shape colliders (cubes, spheres) around the elements that you will interact with
normals example within unity
FBX is the Ideal File Format for Asset Exporting in Maya and Importing in Unity
FBX will be the ideal ﬁle format of choice when you are working with Maya and Unity.
It allows for seamless transfer, more data retained and workﬂow efﬁciency
While Maya mb ﬁle can also be easily imported into Unity to achieve a simlar effect. exporting your ﬁles in Maya
manually into FBX can save much problems in the long run.