The plug-in is designed for Maya 2018. This guide is about the Windows version (a MacOS version is coming soon). To download the plug-in, go to the Github project (https://github.com/BabylonJS/Exporters/tree/master/Maya).
In this folder, you can find the source code of the exporter if you want to update it, and a zip file Maya2Babylon-XX.zip (where XX is the exporter version, currently v1.0.7). Click on the zip file, and click on the Download button.
By default, Windows blocks all .dll files coming from the web, so we have to unblock them first. Select the zip file, and with a right click select Properties, select Unblock, and then OK.
Then, extract the content of the zip file on your computer. Finally, move all .dll files into a directory defined in Maya plug-in path (for example
C:/Program Files/Autodesk/Maya2018/bin/plug-ins). More information on how to install a plug-in in Maya here. In Maya plug-in Manager you should find the Maya2Babylon.nll.dll.
Check Loaded and Auto load, and a new tab should appear:
Congratulations! You did it!
When your scene is ready to be exported, click on the Babylon tab on the top menu, and click on Babylon File Exporter to display the exporter window.
This window is composed of 3 panels:
The Export button should be used to create the Babylon file representing your scene. The Export & Run button will also create the Babylon file, but will also launch your default browser and run the newly made Babylon file. This button is very useful if you just want to test the render of your scene in Babylon.js.
As babylon.js script is retrieved directly from the official website directly, you should have internet access in order to correctly use Export & Run.
The log panel indicates in real time which mesh has been exported, which material, and if there are any problems with these objects.
Option Optimize vertices: The Babylon exporter will try to optimize the number of vertices to export instead of exporting everything naively (if a vertex is part of two faces, this vertex won’t be exported twice with this option checked).
The Scale factor can be used to rescale the whole world. If you set a scale factor equal to 100, the resulting scene will be 100 times smaller (1%). By default the scale factor is equal to 1, meaning no rescale.
If you want to test your scene right away by using the button Export & Run, your scene should have a camera created. Otherwise, the log panel will display the warning “No camera defined” and a default one would be created at runtime but won't be exported in .babylon file.
If you have more than one camera, the first one will be set as activeCamera in Babylon.
If you don’t have any lights in your scene, the exporter will add an ambient light by default. The log panel will display the warning “No light defined – A default ambient light was added for your convenience”.
If you want to have a point in space used only for its transform attributes you can use a Locator. For example, a target camera naturally comes with a locator to indicate the position to look at. They can also be used as parent node when updating the scene at runtime with the Babylon engine.
A group node is exported as a dummy, a mesh without vertices, just like a locator. However, only group nodes used as parent for other nodes are exported. If you have an empty group node, you should probably switch to a locator instead or it will be ignored.
Maya provides a large range of tools to manipulate connexions between textures and materials (like the Reverse node). For the most part, only a fileTexture is expected as input to a material.
Currently the following intermediate nodes are supported by the exporter:
Babylon engine fully supports the following image formats: jpg, bmp, png, gif, tga. You are adviced to use those formats for your textures when exporting to Babylon.
Note that the exporter also supports textures with tif and dds formats. But, those textures will be automatically converted to png by the exporter to ensure compatibility with the Babylon engine.
The handling of physical materials is mimic from glTF format. Detailed explanations here
Babylon engine supports only 2 UV sets. In Maya the first UV set, created by default, is used as UV1 in Babylon. The second UV set is used as UV2. Other UV sets are ignored and UV2 is used instead.
Moreover, Babylon engine supports only 1 UV set per texture. If a single texture is linked to UV1 and any other UV set, the log panel will display the warning “Texture is linked to UV1 and UV2. Only one UV set per texture is supported.” and the texture will be linked to UV1 or UV2 but not both.
Now that you know all about the exporter features, it’s time to use it!