Hello,
ColladaLoader.js fails to parse these dae files. I got these stack trace.
http://localhost:8888/fetch_description/meshes/shoulder_pan_link.dae
ColladaLoader.js:3350 THREE.ColladaLoader: DOMParser: 6.8740234375ms
ColladaLoader.js:3357 THREE.ColladaLoader: File version 1.4.1
ColladaLoader.js:3403 THREE.ColladaLoader: Parse: 64.591064453125ms
ColladaLoader.js:202 Uncaught TypeError: Cannot read property 'build' of undefined
at getBuild (ColladaLoader.js:202)
at getCamera (ColladaLoader.js:1622)
at buildNode (ColladaLoader.js:3032)
at getBuild (ColladaLoader.js:204)
at getNode (ColladaLoader.js:3227)
at buildVisualScene (ColladaLoader.js:3273)
at buildLibrary (ColladaLoader.js:192)
at THREE.ColladaLoader.parse (ColladaLoader.js:3416)
at Object.onLoad (ColladaLoader.js:28)
at XMLHttpRequest.<anonymous> (three.js:30483)
I have investigated base_link.dae
and found the following problem: The file contains nodes in its visual scene that or not defined within their respected <library*>
tags. So the visual scene of base_link.dae
contains a camera and a light node:
<node id="Camera" name="Camera" type="NODE">
<matrix sid="transform">0.6858805 -0.3173701 0.6548619 7.481132 0.7276338 0.3124686 -0.6106656 -6.50764 -0.01081678 0.8953432 0.4452454 5.343665 0 0 0 1</matrix>
<instance_camera url="#Camera-camera"/>
</node>
<node id="Lamp" name="Lamp" type="NODE">
<matrix sid="transform">-0.2908646 -0.7711008 0.5663932 4.076245 0.9551712 -0.1998834 0.2183912 1.005454 -0.05518906 0.6045247 0.7946723 5.903862 0 0 0 1</matrix>
<instance_light url="#Lamp-light"/>
</node>
But there are no definitions of the elements within <library_cameras>
and <library_lights>
. These elements/tags are just missing. For ColladaLoader
such dae
files are not valid right now.
@mrdoob I'm not sure how we should handle this situation. Should we make ColladaLoader
more "tolerant"?
@jihoonl Just one hint: If you delete the faulty nodes in the visual scene, ColladaLoader
is able to load your file.
@mrdoob I'm not sure how we should handle this situation. Should we make ColladaLoader more "tolerant"?
I don't know... The obj loader has similar issues...
I guess for these cases I would first check how Blender handles the files.
Well, the Blender exporter produced the mentioned file :laughing:. Blender is also able to load it.
Okay, the change is actually easy. I'll provide a PR 馃憤
Most helpful comment
Okay, the change is actually easy. I'll provide a PR 馃憤