Jump to content

importMesh of undefined from undefined


tetley_tea
 Share

Recommended Posts

Hi, 

I'm trying to use Angular 2 to create a BabylonJS scene - but seem to having some difficulty getting the OBJ loader to bring in the OBJ model.

I'm getting this error: 

Unable to import meshes from http://localhost.cdn.com/b_azir.obj: importMesh of undefined from undefined version: undefined, exporter version: undefinedimportMesh has failed JSON parse.

http://localhost.cdn.com is just an IIS website that points to a localhost website that contains the model files. (OBJ, MTL and textures). 

I can navigate to http://localhost.cdn.com/b_azir.obj  fine. So that's no issue. 

I can include the code if one wishes. I would create a playground. But does it support TS? 

 

Thanks,

Pete.

Link to comment
Share on other sites

Just now, Deltakosh said:

Hello I think this is because you forgot to load the obj loader?

Hey Deltakosh! 

I have imported the babylonjs library in my TypeScript file . As such: 

import * as BABYLON from 'babylonjs';

I have also imported the babylonjs and babylonjs-loaders types in my tsconfig.json file. 

{
  "compilerOptions": {
    "module": "es2015",
    "moduleResolution": "node",
    "target": "es5",
    "sourceMap": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "skipDefaultLibCheck": true,
    "skipLibCheck": true, // Workaround for https://github.com/angular/angular/issues/17863. Remove this if you upgrade to a fixed version of Angular.
    "strict": true,
    "lib": [ "es6", "dom" ],
    "types": [ "babylonjs", "babylonjs-loaders", "webpack-env" ]
  },
  "exclude": [ "bin", "node_modules" ],
  "atom": { "rewriteTsconfig": false }
}

Am I missing something? 

I installed babylonjs locally using NPM: 

npm install babylonjs babylonjs-loaders --save-dev

Thanks,

Pete.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...