To export your animation from Maya, we will first need to download a plugin. You can download the latest version HERE, or download a mirror of version 1.1.1 (12 August 2020) HERE. Unzip all the contents into one folder, and then run the “maya2glTFDeploy.bat” file. A command line should appear to should automatically install itself into your version of Maya. Press any button to close it afterwards.
Once you’re in Maya, open your Plug-in Manager. You should be able to find it under Windows > Settings/Preferences, like so:
Then, locate “maya2glTF” in your Plug-in Manager. Ensure that it is both Loaded and Auto-Loaded. Otherwise, check the boxes to make them like so:
Once that is done, you should be able to see a shelf called “glTF” with the corresponding icons:
First, select your entire rig from the top-most node. Then select the entire hierarchy. Afterwards, click the left most icon on the glTF shelf. You should see this:
Without clicking away from your selected hierarchy, click “assign PBR shader to selection”. This will assign a GLSL shader to your meshes. To be able to export the image textures properly, this shader should always be used when using this plugin. A popup with “Select all textures” will appear. Ignore that, and close it. You should now have your meshes assigned to a “GLSLShader1”. Feel free to rename it as you deem fit.
Relink your textures to the corresponding maps. GLSL supports: Base colour (sRGB), Metallic, Roughness, Occlusion, Normal, Emissive, Diffuse environment, Specular environment, and BRDF LUT maps. You can assign another GLSL material to another selection of your model using the same button. Be sure to clean up and delete any other unused materials and shaders to ensure the smallest filesize.
Once that is done, select your entire hierarchy again, and open the maya2glTF plugin again. This time, input the following parameters:
output Folder: By default, it should be an “export” folder at where your scene file is. You can change this to whatever you like.
copyright: It will be your computer name by default. Change it to whatever you like.
scene name: Filename by default. Change it to whatever you like. This will export as the .GLB filename.
scale factor: 1.000000 by default. DO NOT CHANGE THIS.
selected only, visible only: Checked by default. Unless you have any other reason to, DO NOT CHANGE THIS.
extra flags: Empty by default. Enter “-glb” into the field.
animation: “none” by default. Select “time slider” from the drop-down box, and ensure all your animation is within the time slider. It will only support one track and does not allow for specific frames other than what is shown on your time slider.
clip name: “clip” by default. Change it to whatever you like, though there is no consequence.
Once you have entered the correct parameters, click “export selected meshes” and you should be able to find a .GLB and .JSON file in the specified output folder. The .GLB is your final Android product. You can safely dispose of the .JSON file with no consequence.