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>2018-11-25 10:02:48 +0300
committerJulien Duroure <julien.duroure@gmail.com>2018-11-25 10:02:48 +0300
commitca90ba2b753a846158d0723dfcb0c6eb1fae3288 (patch)
tree3c4ff06595e2c7d10da7043dd11d0794f3f5ab00
parent090fe6db8704f3020a47f4da506f81d6dc194d7e (diff)
glTF importer: Check that there are nodes
Something is wrong in file if there are no nodes, but this check avoid the addon to crash
-rwxr-xr-xio_scene_gltf2/blender/imp/gltf2_blender_gltf.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py b/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py
index 9f8a3584..0c819f9c 100755
--- a/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py
+++ b/io_scene_gltf2/blender/imp/gltf2_blender_gltf.py
@@ -152,6 +152,10 @@ class BlenderGlTF():
if 'glossinessFactor' not in material.extensions['KHR_materials_pbrSpecularGlossiness'].keys():
material.extensions['KHR_materials_pbrSpecularGlossiness']['glossinessFactor'] = 1.0
+ if gltf.data.nodes is None:
+ # Something is wrong in file, there is no nodes
+ return
+
for node_idx, node in enumerate(gltf.data.nodes):
# skin management