diff options
Diffstat (limited to 'io_scene_gltf2/blender/imp/gltf2_blender_scene.py')
-rwxr-xr-x | io_scene_gltf2/blender/imp/gltf2_blender_scene.py | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/io_scene_gltf2/blender/imp/gltf2_blender_scene.py b/io_scene_gltf2/blender/imp/gltf2_blender_scene.py index 2092a6be..672b68c8 100755 --- a/io_scene_gltf2/blender/imp/gltf2_blender_scene.py +++ b/io_scene_gltf2/blender/imp/gltf2_blender_scene.py @@ -36,12 +36,18 @@ class BlenderScene(): BlenderNode.create_vnode(gltf, 'root') # User extensions before scene creation - import_user_extensions('gather_import_scene_after_nodes_hook', gltf, gltf.data.scenes[gltf.data.scene], scene) + gltf_scene = None + if gltf.data.scene is not None: + gltf_scene = gltf.data.scenes[gltf.data.scene] + import_user_extensions('gather_import_scene_after_nodes_hook', gltf, gltf_scene, scene) - # User extensions after scene creation BlenderScene.create_animations(gltf) - import_user_extensions('gather_import_scene_after_animation_hook', gltf, gltf.data.scenes[gltf.data.scene], scene) + # User extensions after scene creation + gltf_scene = None + if gltf.data.scene is not None: + gltf_scene = gltf.data.scenes[gltf.data.scene] + import_user_extensions('gather_import_scene_after_animation_hook', gltf, gltf_scene, scene) if bpy.context.mode != 'OBJECT': bpy.ops.object.mode_set(mode='OBJECT') |