ColladaLoader instance nodes imported with names like ‘instance_0’

Description of the problem

After the replacement of ColladaLoader with ColladaLoader2 (now named just ColladaLoader), it looks like the imported information has changed a little bit.

heres a (condensed) snippet of my dae.

<library_nodes>
  <node id="ID3" name="Element_entry-door-handle">
    <node id="ID47" name="instance_3">
      </matrix>
      <instance_node url="#ID48" />
    </node>
  </node>
  <node id="ID48" name="Anchor">
    </instance_geometry>
  </node>
</library_nodes>

the behavior that i used to see was that the imported dae object would look like this:

scene.children[0] = [
  {
    name: 'Element_entry-door-handle',
    children: [
      {
        name: 'Anchor'
      }
    ]
  }
]

now it is looking like this:

scene.children[0] = [
  {
    name: 'instance_0',
    children: [
      {
        name: 'instance_3'
      }
    ]
  }
]

is this the expected output? on one hand i see at as incorrect because of how ColladaLoader used to work, but on the other hand i see it as correct because it matches how the dae is represented.

i am able to achieve what i need by doing a search through library.nodes and marrying the ‘instance’ up with its original definition and getting that name.

would you accept a PR if i ensure that instance nodes are coming through with their definitions name rather than 'instance_0', 'instance_1' etc?

i’ll work on putting together a jsfiddle and updating this issue once complete.

Three.js version
  • Dev
  • r90
  • r88
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, …)

Author: Fantashit

1 thought on “ColladaLoader instance nodes imported with names like ‘instance_0’

Comments are closed.