Creating GLB files using Maya and Substance Painter

Use Maya and Substance Painter to export a GLB file that can be added to a product in the Shopify admin.

Prepare your model for export in Maya

To prepare your model for export, you need to make sure that it's a single mesh and that it has a single material applied to it.

Steps:

  1. Import your model into Maya by going to File > Import..., choosing your 3D file, and then clicking Import.
  2. Click Mesh > Combine to combine your mesh into a single object.
  3. Unwrap the model into 0-1 UV space. Make sure that no UVs overlap:
    Use the UV Editor to lay out the UVs between 0 and 1 on the X and Y axes.
  4. Apply a Phong material to the model:
    1. With your mouse cursor over the model, right click and hold, and then select Assign New Material...
    2. From the dialog, select Phong.

Export the mesh from Maya

  1. Select the entire mesh, and then click File > Export Selection...
  2. Enter a file name and the location where the file should be saved.
  3. From the Files of type drop-down menu, select OBJexport.
  4. Click Export Selection.

Import and prepare the OBJ file in Substance Painter

  1. Create a new Substance Painter project by clicking File > New.
  2. In the New project dialog, click Select to choose a mesh.
  3. Select the OBJ file that you exported from Maya, and then click Open.
  4. In the New project window, click OK.
  5. Verify that you correctly exported your mesh by checking that there's only one texture set in the Texture set list panel.
  6. In the Texture set settings panel, click the + button to add channels:
    The + button is beside the Channels heading. The button opens a drop-down menu that shows the additional channels that are available.
    • Required: Ambient occlusion.
    • Optional: Emissive. Add this channel if your model has components that will emit light.
    • Optional: Opacity. Add this channel if your model has components that will be transparent.
  7. In the Texture set settings panel, click Bake Mesh Maps.
  8. Paint textures on to the model.

Multiple texture sets

When you import the OBJ file into Substance Painter, you should see only one texture set:

Texture sets are listed in the Texture set list panel.

If you see more than one texture set, then one of the following was wrong when the mesh was exported from Maya:

  • The mesh wasn't combined into a single object.
  • The mesh had more than one texture assigned to it.

If that's the case, then export your model from Maya again and make sure that the mesh is a single object and has only a single texture assigned to it.

Export the glTF file from Substance Painter

  1. Click File > Export Textures.
  2. From the Config drop-down menu, select glTF PBR Metal Roughness.
  3. Choose the location where you want to save your textures.
  4. Choose a document size to determine how large the texture files will be.

  5. Click Export.

Compressing texture files

When you have exported the model, you should have the following files:

  • modelName.bin
  • modelName.glb
  • modelName.gltf
  • modelNamebaseColor.png
  • modelNamenormal.png
  • modelName_occlusionRoughnessMetallic.png

When using the glTF PBR Metal Roughness configuration, Substance Painter exports texture files only in PNG format. Consider compressing the texture files and converting any textures that don't need an alpha channel to a JPG. This reduces the total file size, and smaller file sizes allow for quicker download speeds and smoother interactions.

It's best to keep your file size to 4 MB or smaller.

Create a GLB file

  1. Visit https://glb-packer.glitch.me/.
  2. Drag and drop the files that you exported from Substance Painter on to the GLB Packer web page.

A file called out.glb will be downloaded to your computer. After the download is complete, you can rename the file and then upload it to Shopify.