This works for saving other models just fine to glb but for some reason when exporting .dae with jpgs attached to them, in my case Smiley face loses its color and exports a glb smiley face that is all black. Same happens on other loaders if it even loads.
Any way I can retain the .jpg textures on export?
the php file simply saves to a file to be viewed. Already tested and works to save glbs
Are you running that JS on the server, or in the browser? I’m not sure if textures work right in nodejs… if it’s in the browser i’d suggest filing a bug, assuming the COLLADA file works in threejs.org/editor/ before conversion.
This is in the browser. It loads properly on my page and on https://blackthread.io/gltf-converter/ . However when exporting to glb it loses the .jpg coloring and texture. It doesn’t seem to load in the threejs.org editor.
Um, but exporting to glTF does not seem to work. The resulting file does load in gltf-viewer and babylon.js sandbox but without the texture. However, I can see that an image is defined in the glTF manifest file.
It took quite some time to figure out what’s going wrong.
The problem is that the Collada asset has a vertex color attribute with just black color values. ColladaLoader does not automatically set Material.vertexColors to THREE.VertexColors. GLTFLoader does however. So the problem is that the black vertex colors overshadows the diffuse texture. Hence, it appears no texture is applied at all.
The workaround is to set vertexColors to THREE.NoColors. Or you fix the Collada asset in the first place and remove the vertex color attribute.