title: Three.js: loader.setPath is undefined
body: <p>Hello developers and geniuses,</p>
  
  <p>I am trying to simply import an obj-model to my three.js scene with WebGLrenderer.</p>
  
  <p>I tried a lot of different tutorials but nothing worked for me. I always get the following error:</p>
  
  <p>TypeError: loader.setPath is not a function. loader.setPath is undefined. The module that's getting the error is MTLLoader.js.</p>
  
  <p>I implemented the js-File in my html head and of course I also did with three.min.js and OBJLoader.js.</p>
  
  <p>I just don't know what to do. Can anyone help me and have a look at the specific code-piece?</p>
  
  <blockquote>
    <p>var mesh2 = null;</p>
    
    <p>var mtlLoader = new THREE.MTLLoader(); mtlLoader.setBaseUrl(
    "myurlpath" ); mtlLoader.setPath(
    "myurlpath" ); mtlLoader.load(
    'WaltHead.mtl', function( materials ) {</p>
    
    <p>materials.preload();</p>
    
    <p>var objLoader = new THREE.OBJLoader();   objLoader.setMaterials(
    materials );   objLoader.setPath("myurlpath" );   objLoader.load(
    'WaltHead.obj', function ( object ) {</p>
  
  <pre><code>mesh2 = object;
  mesh2.position.y = -50;
  scene.add( mesh2 );
  </code></pre>
    
    <p>} );</p>
    
    <p>} );</p>
  </blockquote>
  
  <p>Thanks for any help :-)</p>