<p dir="auto"><strong>Describe the bug</strong><br>
After upgrading three to r123 on a working project, that was before using r119, three cannot find some Camera's anymore. Strangely enough it can find some cameras, but not others. It doesn't seem to be related to ortographic vs perspective. It looks like the problem arrises only with nested camera's, so cameras within other 3D objects. But I'm not completely sure yet.</p>
<p dir="auto">I've read all migration guides from r119 -&gt; r120 up to the last one, but cannot find anything in there that should cause this IMO.</p>
<p dir="auto">I'm still debuging, but so far this seems to be the issue: <code class="notranslate">getObjectByName()</code> can find some camera's, but others return <code class="notranslate">undefined</code> so cannot be found in the scene loaded by gltf. Before this was working fine, the only thing I needed to do before was traverse this object, because for some reason camera's are wrapped inside some object in gltf. But now even the wrapper object cannot be found. It is still in the gltf or glb though, nothing changed to the data.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="const cameraWrap = scene.getObjectByName(camName);"><pre class="notranslate"><code class="notranslate">const cameraWrap = scene.getObjectByName(camName);
</code></pre></div>
<p dir="auto">I keep you informed if I know more when exactly this happens. But for now please let me know if something has changed that could cause this that I should be aware of! Thanks</p>
<p dir="auto"><strong>To Reproduce</strong></p>
<p dir="auto">Steps to reproduce the behavior:</p>
<ol dir="auto">
<li>Create a scene with objects and camera's in blender (probably the problem occurs when cameras are nested (and nested) within 3D objects, but not sure yet)</li>
<li>Use the blender gltf or glb export to export to gltf or glb</li>
<li>Import the gltf or glb in three to get the scene</li>
<li>Try to get the cameras by using <code class="notranslate">scene.getObjectByName(camName)</code></li>
</ol>
<p dir="auto"><em><strong>Code</strong></em></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="scene.getObjectByName(camName)"><pre class="notranslate"><span class="pl-s1">scene</span><span class="pl-kos">.</span><span class="pl-en">getObjectByName</span><span class="pl-kos">(</span><span class="pl-s1">camName</span><span class="pl-kos">)</span></pre></div>
<p dir="auto"><strong>Expected behavior</strong></p>
<p dir="auto">Nothing changed in three version according to the migration guide around cameras or objects AFAIK, so I would expect this to still work in r123.</p>
<p dir="auto"><strong>Platform:</strong></p>
<ul dir="auto">
<li>Device: Desktop/Mobile</li>
<li>OS: Windows</li>
<li>Browser: Edge Chromium</li>
<li>Three.js version: r123</li>
</ul>
<h5 dir="auto">Description of the problem</h5>
<p dir="auto">I use a tool called OarConv which produces collada files with multiple <code class="notranslate">&lt;polylist&gt;</code> elements in one <code class="notranslate">&lt;mesh&gt;</code> refering to the same material. This works in colladaloader but in colladaloader2 there seems to be a design flaw that the return value of buildGeometry() is a group which is a map indexed by the material name and which contains just one THREE.Mesh (or similar) object per material name, so when the function runs it overwrites the preceeding 's representation with the succeding one.</p>
<p dir="auto">I am not totally convinced that this Collada is within the specification but it seems logical that you can have multiple s with the same material and these colladas load in blender and 3ds max and unity.</p>
<p dir="auto">As this is an architectural level issue I don't see a possibility for me to fix it, there is no easy patch that can be done. I was thinking about uniquifying the material name and duplicating the definition but that was too much of a hack for me to bear...</p>
<p dir="auto"><a href="https://github.com/mrdoob/three.js/files/535814/oar_house.txt">oar_house.txt</a></p>
<p dir="auto">Attached .txt file is actually a dae file.</p>
<h5 dir="auto">Three.js version</h5>
<ul class="contains-task-list">
<li>[x ] Dev (also tried r74 but the code looks the same)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> r81</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> ...</li>
</ul>
<h5 dir="auto">Browser</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> All of them (obviously)</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Chrome</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Firefox</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Internet Explorer</li>
</ul>
<h5 dir="auto">OS</h5>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> All of them</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Windows</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Linux</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> Android</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> IOS</li>
</ul>
<h5 dir="auto">Hardware Requirements (graphics card, VR Device, ...)</h5>