GLTFExporter: Exported models not working with Unity/GLTF Loader

When exporting a GLTF file from Three.js and then loading it with Unity/GLTF Loader. it allways fails with a NulleReferenceException.

It occurred to me that the example files enclosed with the Unity repo are all small GLTF files with an additional .bin file. (i.e. :

  • model.gltf (4kb)
  • model.bin (1mb) )

Is there a possibility to generate these .bin files as well?
Weirdest part to me is that the Three.js files are loaded OK by Windows MR viewer, but the example files do not load…

Author: Fantashit

1 thought on “GLTFExporter: Exported models not working with Unity/GLTF Loader

    1. An export with bin file … not working (THREE.GLTFLoader: Unexpected light type, “3”.)

    It sounds like this asset has come through an old version of the BabylonJS 3DS Max exporter? It had a bug, but if you update the exporter to the latest version, it should fix this error.

    1. An export without bin file and textures not embedded. … not working (missing textures error)

    This export setting is kind of useless unless your textures happen to be externally hosted on a CDN. I think we’ll probably want to remove it at some point.

    It seemed my THREE.Mesh objects had no valid userData, so [setting userData to empty objects] resolves my initial error:

    I’m not sure I understand this … what userData was there before that you’re overwriting?

    Thank you also for the gltf-pipeline suggestion, maybe this would be a good way to implement draco compression?

    It’s a good way to add compression too, yes. 🙂

    Anyway, glad things are working now!

Comments are closed.