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.
i'll work on putting together a jsfiddle and updating this issue once complete.
馃憤
alright i am super close, i just need a way of referencing the previous version of ColladaLoader.js in the demo to show the old functionality.
i have logging in the console to show the part of the scene that has the instance_0 name. here is the demo: http://jsfiddle.net/zhpv6pn6/7/.
you can find my dae at https://raw.githubusercontent.com/shelbyspeegle/threejs-13365/master/source-model.dae.
Can you please check what happens if you change the following line of code to:
if ( object.name === '' ) object.name = ( type === 'JOINT' ) ? data.sid : data.name;
Does this change improve the names of your scene graph elements?
yes! thanks for the line number too! passing all my tests now without special lookup against library nodes 馃憤
Do you wanna make a PR with the change? I think we can put this in ColladaLoader.
sure!
Most helpful comment
sure!