[Bf-extensions-cvs] [285deaf2] master: glTF importer: Show specific error when buffer resource is missing
Julien Duroure
noreply at git.blender.org
Sun Dec 13 18:10:29 CET 2020
Commit: 285deaf22c279a607867158b529c0ddec01f9202
Author: Julien Duroure
Date: Sun Dec 13 18:09:33 2020 +0100
Branches: master
https://developer.blender.org/rBA285deaf22c279a607867158b529c0ddec01f9202
glTF importer: Show specific error when buffer resource is missing
===================================================================
M io_scene_gltf2/__init__.py
M io_scene_gltf2/io/imp/gltf2_io_gltf.py
===================================================================
diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index 31bef8b7..d8bee58c 100755
--- a/io_scene_gltf2/__init__.py
+++ b/io_scene_gltf2/__init__.py
@@ -15,7 +15,7 @@
bl_info = {
'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
- "version": (1, 5, 8),
+ "version": (1, 5, 9),
'blender': (2, 91, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',
diff --git a/io_scene_gltf2/io/imp/gltf2_io_gltf.py b/io_scene_gltf2/io/imp/gltf2_io_gltf.py
index 83969d94..5bbab579 100755
--- a/io_scene_gltf2/io/imp/gltf2_io_gltf.py
+++ b/io_scene_gltf2/io/imp/gltf2_io_gltf.py
@@ -161,8 +161,10 @@ class glTFImporter():
if buffer.uri:
data = self.load_uri(buffer.uri)
- if data is not None:
- self.buffers[buffer_idx] = data
+ if data is None:
+ raise ImportError("Missing resource, '" + buffer.uri + "'.")
+ self.buffers[buffer_idx] = data
+
else:
# GLB-stored buffer
More information about the Bf-extensions-cvs
mailing list