Problems loading a .stl file

Good afternoon, all!

So I’m trying to load an .stl model in a local project and ran across an error.
The Playground I’m using does not have the problem and loads fine.


var assetsManager = new BABYLON.AssetsManager(scene);
meshTask = assetsManager.addMeshTask(“mtask”, “”, modelpath, modelname + “.stl”);
meshTask.onError = function (e) { console.log(e); }

I get the following _errorObject message:

Unable to import meshes from UH-60.stl: importMesh of undefined from undefined version: undefined, exporter version: undefinedimportMesh has failed JSON parse

and the exception stack has:

SyntaxError: Invalid character at importMesh
at Anonymous function
at m (http://localhost:99999/babylon.js:23246:41)
at p (http://localhost:99999/babylon.js:2914:172)

I made sure to add the mime extension to the web config file in the system.webServer tag as I previously had to do with .OBJ files to get them to work.

Any extra things I might be missing?

Oh just FYI. Network console says that it loads but that the .manifest file (which I don’t have) cannot be found.

Hello did you make sure to add a reference to the STL importer?

1 Like

O.M.G. i was dumb. thanks for the reminder. it loads now.

1 Like