glTF exporter: fix crash trying to export area lights (not supported)

This commit is contained in:
Julien Duroure 2019-11-23 08:32:18 +01:00
parent da9a0d0c51
commit c172be1c93
2 changed files with 3 additions and 2 deletions

View File

@ -15,7 +15,7 @@
bl_info = {
'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
"version": (1, 1, 11),
"version": (1, 1, 12),
'blender': (2, 81, 6),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',

View File

@ -74,7 +74,8 @@ def __gather_node(blender_object, blender_scene, export_settings):
node.translation, node.rotation, node.scale = __gather_trans_rot_scale(blender_object, export_settings)
if export_settings[gltf2_blender_export_keys.YUP]:
if blender_object.type == 'LIGHT' and export_settings[gltf2_blender_export_keys.LIGHTS]:
# Checking node.extensions is making sure that the type of lamp is managed, and will be exported
if blender_object.type == 'LIGHT' and export_settings[gltf2_blender_export_keys.LIGHTS] and node.extensions:
correction_node = __get_correction_node(blender_object, export_settings)
correction_node.extensions = {"KHR_lights_punctual": node.extensions["KHR_lights_punctual"]}
del node.extensions["KHR_lights_punctual"]