Closed etacarinaea closed 2 weeks ago
Thanks for the PR I will have a look soon
Some files are now renamed in main branch. Can you please rebase your PR? Thanks :)
Hello, With this setup (photo.blend is linked into scene.blend), exporting scene.blend to scene.glb or scene.gltf => I am not able to reproduce the issue on main branch.
Can you please create a zip with right setup of directory that shows the issue?
Here's the zip: gltf-blender-io_library-uri_test.zip
.
├── assets
│ ├── asset.bin
│ ├── asset.blend
│ └── asset.gltf
├── img
│ └── test.png
├── test.bin
├── test.blend
└── test.gltf
I think I forgot to mention that this only seems to happen when "keep original" is checked while exporting as a gltf. The zip includes the resulting gltf files from exporting the original scene (asset.blend) and the scene with the object linked (test.blend). The gltf of the original one correctly includes the image path, the one with the linked object doesn't.
Output from git diff -- test.gltf assets/asset.gltf
:
@@ -44,6 +47,19 @@
]
}
],
+ "textures":[
+ {
+ "sampler":0,
+ "source":0
+ }
+ ],
+ "images":[
+ {
+ "mimeType":"image/png",
+ "name":"test.png",
+ "uri":"../img/test.png"
+ }
+ ],
"accessors":[
{
"bufferView":0,
when "keep original" is checked
It was the missing part! Thanks :)
Merged, thanks!
When exporting a scene that has linked objects with materials that have relative paths to images, the absolute path of those images was being determined by taking that path relative to the current scene's path, instead of relative to the original path of the library, which would result in the images not being found if the current scene and the library weren't in the same directory. This PR fixes that.