title: three.js - add multiple objects (obj & mtl) with a loop
body: <p>I have a problem in my code and I can't found the mistake(s)... I have a loop which load multiple obj and give them a name but as a result the "objects" array is empty... I would like to give to each object a name in order to detect the intersections (the code is OK for that). It's very tricky because when I click on the different parts of the loaded object (a cathedral), the database is contacted but all the objects have the same name. Do you know why ? Here is the code: objects is the array which stores the all geometries, and object is the argument of the function. load_obj is defined by a loop below (string store in another array: OBJETS which store the name of obj of all parts of the cathedral). </p>
  
  <pre><code>for (var i in OBJETS){   
  load_obj = OBJETS[i];
  loader.load('./Donnees/OBJ/'+load_obj+'.obj','./Donnees/OBJ/'+load_obj+'.mtl', function ( object ) { 
        object.name=load_obj;         
        scene.add( object );      
        objects.push(object);     }, onProgress, onError );       
  }
  </code></pre>
  
  <p>Thanks for your help !</p>