Closed shenzhuxi closed 6 years ago
Can you please provide a .blend file and the settings you used?
I created this one from mixamo.com following https://donmccurdy.com/2017/11/06/creating-animated-gltf-characters-with-mixamo-and-blender/. Export settings were all default. Eve.blend.zip
I am having no problems exporting the supplied blend file with the default settings. It looks like the error could have resulted from some permission issues. Are you sure you are outputting the files somewhere that you have permission to access? You mentioned that you were on Mac OS. I do not have access to a Mac, so I have not done any testing on that. It is possible that something is getting screwed up with paths on Mac OS.
If you don't mind editing the source files, it would be helpful if you could print out "path" before it is used on line 2254 in blendergltf. I would like to know if the value of that variable matches up with where you are trying to output the files.
I don't know what's the right way to debug in Blender and just used logging like this:
for path, data in state['files'].items():
logging.debug(path)
with open(path, 'wb') as fout:
fout.write(data)
And got "DEBUG:root:file2.png" in the log and error like this
Traceback (most recent call last): File "/Users/HOME/Library/Application Support/Blender/2.79/scripts/addons/blendergltf-master/init.py", line 488, in execute gltf = export_gltf(data, settings) File "/Users/HOME/Library/Application Support/Blender/2.79/scripts/addons/blendergltf-master/blendergltf.py", line 2257, in export_gltf with open(path, 'wb') as fout: PermissionError: [Errno 13] Permission denied: 'file2.png'
location:
I got no file output for the first time run after launch Blender. After the second run, I got the same log and error, but had file1.png, file2.png and file3.png exported.
Then I turned Blender off and on again, left 3 files in the output directory and tried export again. I got log "DEBUG:root:file3.png" and PermissionError: [Errno 13] Permission denied: 'file3.png'.
It looks like the output path for packed images was a little different than unpacked images. I have not had a problem with the difference in Linux, but perhaps it was causing this bug. Could you try exporting again with the latest master?
It's working with the latest master now. Thanks.
Thank you for reporting the issue and testing the fix.
I installed blendergltf-master.zip on Blender v2.79 on Mac. The model I used is https://www.mixamo.com/#/?page=1&query=gonzales&type=Character
The first problem is https://github.com/donmccurdy/three-gltf-viewer/issues/78
The second problem only happened some times when I exported after I opened a saved .blend file. I got this error if I used Copy or Reference instead of Embed for images, and can only find images file1.png file2.png and file3.png but not the gltf file in the output directory.
Traceback (most recent call last): File "/Users/HOME/Library/Application Support/Blender/2.79/scripts/addons/blendergltf-master/init.py", line 488, in execute gltf = export_gltf(data, settings) File "/Users/HOME/Library/Application Support/Blender/2.79/scripts/addons/blendergltf-master/blendergltf.py", line 2254, in export_gltf with open(path, 'wb') as fout: PermissionError: [Errno 13] Permission denied: 'file3.png'
location::-1
BTW, the output from https://github.com/KhronosGroup/glTF-Blender-Exporter works with drag-and-drop three.js glTF viewer, but only the first 2 images were exported.