Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Duroure <julien.duroure@gmail.com>2019-08-09 20:43:24 +0300
committerJulien Duroure <julien.duroure@gmail.com>2019-08-09 20:56:13 +0300
commit5a937edabb313e4924ba66c21a745ab142e9b5ef (patch)
tree7a6d782dde10bed8bbd587b115314b2de91f4c69 /io_scene_gltf2/io
parenta238b0325d2f7063e94df1a2e6e525ea3c43796f (diff)
glTF importer: manage escaped uri for texture files
Diffstat (limited to 'io_scene_gltf2/io')
-rwxr-xr-xio_scene_gltf2/io/imp/gltf2_io_binary.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/io_scene_gltf2/io/imp/gltf2_io_binary.py b/io_scene_gltf2/io/imp/gltf2_io_binary.py
index 498d49e8..92450672 100755
--- a/io_scene_gltf2/io/imp/gltf2_io_binary.py
+++ b/io_scene_gltf2/io/imp/gltf2_io_binary.py
@@ -15,6 +15,7 @@
import struct
import base64
from os.path import dirname, join, isfile, basename
+from urllib.parse import unquote
class BinaryData():
@@ -159,9 +160,9 @@ class BinaryData():
data = pyimage.uri[idx + len(sep):]
return base64.b64decode(data), image_name
- if isfile(join(dirname(gltf.filename), pyimage.uri)):
- with open(join(dirname(gltf.filename), pyimage.uri), 'rb') as f_:
- return f_.read(), basename(join(dirname(gltf.filename), pyimage.uri))
+ if isfile(join(dirname(gltf.filename), unquote(pyimage.uri))):
+ with open(join(dirname(gltf.filename), unquote(pyimage.uri)), 'rb') as f_:
+ return f_.read(), basename(join(dirname(gltf.filename), unquote(pyimage.uri)))
else:
gltf.log.error("Missing file (index " + str(img_idx) + "): " + pyimage.uri)
return None, None