Skip to content

Exporter Reference

Technical Details

Use this reference for translator names, scripting entry points, MEL options, and advanced exporter behavior.

Translator Name

Maya registers the exporter as glTF2.0 Export.

MEL Examples

Export Selection

file -force -options "fileFormat=glb;resFormat=source;anim=time_editor;texFormat=auto;texQuality=90;dracoEnabled=0;meshQuantization=0;exportTangents=0;exportGaussianSplats=0;exportQuadTopology=0;assetMinVersion=2.0;" -type "glTF2.0 Export" -preserveReferences -exportSelected "C:/temp/asset.glb";

Export All

file -force -options "fileFormat=gltf;resFormat=source;anim=baked;texFormat=webp;texQuality=90;dracoEnabled=1;dracoPreset=balanced;meshQuantization=0;exportTangents=1;exportGaussianSplats=0;exportQuadTopology=0;assetMinVersion=2.0;" -type "glTF2.0 Export" -preserveReferences -exportAll "C:/temp/asset.gltf";

Python Example

import maya.cmds as cmds

cmds.file(
    "C:/temp/asset.glb",
    force=True,
    options="fileFormat=glb;anim=time_editor;texFormat=auto;texQuality=90;dracoEnabled=0;meshQuantization=0;exportTangents=0;exportGaussianSplats=0;exportQuadTopology=0;assetMinVersion=2.0;",
    type="glTF2.0 Export",
    preserveReferences=True,
    exportSelected=True,
)

Options String Reference

All exporter options are passed as semicolon-separated key=value pairs.

Output Options

  • fileFormat: glb, gltf Default: glb
  • resFormat: bin, source, embedded Default for the registered translator: source
  • texFormat: auto, jpeg, webp Default: auto
  • texQuality: 0 to 100 Default: 90
  • texOverwrite: 0 or 1 Default: 1
  • copyright: freeform string
  • assetMinVersion: 2.0 or empty Default: 2.0 Sets the asset.minVersion field in the glTF JSON output. This field signals to loaders the minimum glTF version they must support to parse the file. Most loaders ignore this field; leave it at 2.0 unless you have a specific loader requirement.

Animation Options

  • anim: none, keyed, baked, time_editor Default: time_editor

Mesh Options

  • exportTangents: 0 or 1 Default: 0
  • exportGaussianSplats: 0 or 1 Default: 0
  • exportQuadTopology: 0 or 1 Default: 0

Extension and Compression Options

  • meshQuantization: 0 or 1 Default: 0
  • dracoEnabled: 0 or 1 Default: 0
  • dracoStrip: 0 or 1
  • dracoPreset: fast, balanced, high, max, custom
  • dracoCompressionLevel: 0 to 10
  • dracoQuantPos: 10 to 30
  • dracoQuantNormal: 8 to 30
  • dracoQuantTexcoord: 8 to 30
  • dracoQuantColor: 8 to 30
  • dracoQuantGeneric: 8 to 30

KTX2 Options

These are used together with the UI's KTX2 mode.

  • ktx2Enabled: 0 or 1
  • ktx2Compression: etc1s, uastc, astc, none
  • ktx2Quality: 0 to 255
  • ktx2Supercomp: 0 or 1
  • ktx2Mipmaps: 0 or 1

Metadata Objects

  • assetExtensions: JSON object string Injects additional entries into the asset.extensions object in the glTF output. Provide a valid JSON object as a string, for example: {"MY_pipeline_tag":{"version":"1.2"}}.

  • assetExtras: JSON object string Injects additional entries into the asset.extras object in the glTF output. Use this to stamp custom pipeline metadata, build IDs, or any freeform key-value data into the exported file. Provide a valid JSON object as a string, for example: {"buildId":"42","project":"my_asset"}.

Both values must be valid JSON objects (wrapped in {}). Invalid JSON is silently ignored.

Notes

  • In the UI, choosing KTX2 Format writes texFormat=auto together with ktx2Enabled=1.
  • Each export starts from its own option set, so settings from one export should not affect the next export.
  • Gaussian splat export is conditional even when enabled: the external bridge must be available.

Non-Stingray ORM Graph Resolution

For standardSurface, aiStandardSurface, and openPBRSurface, the exporter resolves metallic, roughness, and AO textures by tracing the real upstream source plug through optional multiplyDivide nodes.

Cheat Sheet

Source setup Allowed? Conditions Export result
Separate grayscale AO only Yes Connect through gltfAO; outColor, outColorR, outColorG, or outColorB are all valid; any single multiplyDivide lane X, Y, or Z is valid Original grayscale image exports as occlusionTexture
Separate grayscale metallic only Yes outColor, outColorR, outColorG, or outColorB are all valid; any single multiplyDivide lane X, Y, or Z is valid Original grayscale image exports as metallicRoughnessTexture
Separate grayscale roughness only Yes outColor, outColorR, outColorG, or outColorB are all valid; any single multiplyDivide lane X, Y, or Z is valid Original grayscale image exports as metallicRoughnessTexture
Separate grayscale metallic + roughness Yes Source images must have matching dimensions if the exporter needs to repack them Exporter generates a packed MR texture
Separate grayscale AO + metallic Yes AO must connect through gltfAO; source images must have matching dimensions if repacked Exporter generates a packed OM texture
Separate grayscale AO + roughness Yes AO must connect through gltfAO; source images must have matching dimensions if repacked Exporter generates a packed OR texture
Separate grayscale AO + roughness + metallic Yes AO must connect through gltfAO; all source images must have matching dimensions Exporter generates a packed ORM texture
One shared multiplyDivide node for grayscale AO, roughness, and metallic Yes Exporter traces the actual upstream plug; each signal may use any lane X, Y, or Z Same result as the matching grayscale row above
Separate multiplyDivide nodes per grayscale channel Yes Each signal may use any lane X, Y, or Z Same result as the matching grayscale row above
Packed ORM using one shared texture node Yes Metallic must come from source B, roughness from source G, AO from source R via gltfAO; the multiplyDivide lane may still be X, Y, or Z Source image is reused as metallicRoughnessTexture; AO is also reused only when gltfAO is connected
Packed ORM using multiple texture nodes that point to the same file Yes Same source-channel rules as above; file path must resolve to the same image Same as shared packed ORM reuse
Packed ORM with one shared multiplyDivide node Yes Same packed source-channel rules: R = AO via gltfAO, G = roughness, B = metallic Same as shared packed ORM reuse
Packed ORM with separate multiplyDivide nodes Yes Same packed source-channel rules: R = AO via gltfAO, G = roughness, B = metallic Same as shared packed ORM reuse
Packed metallic + roughness from one image, AO from a different file Yes Metallic and roughness must still resolve to the same packed image; AO stays separate through gltfAO Packed image exports as metallicRoughnessTexture; AO exports as a separate occlusionTexture
Packed ORM without gltfAO connected Yes Metallic must come from source B and roughness from source G Exporter writes metallicRoughnessTexture only; no occlusionTexture is emitted

Rules to remember

  • For dedicated grayscale AO, roughness, and metallic maps, source channel and multiplyDivide lane are flexible.
  • For packed ORM reuse, source channel is strict even though the multiplyDivide lane is flexible: R = AO, G = roughness, B = metallic.
  • When the exporter generates a packed OR, OM, MR, or ORM texture, the source images must have matching dimensions.

For custom material attributes, alpha mode setup, and shader-specific notes, see Material Authoring. For UV set assignment and exporter resolution order, see UV Set Selection.