Skip to content

Commit

Permalink
Fix #786 crash trying to export area lights
Browse files Browse the repository at this point in the history
  • Loading branch information
julienduroure committed Nov 23, 2019
1 parent 92193dd commit 439b984
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
if blender_object.type == 'LIGHT' and export_settings[gltf2_blender_export_keys.LIGHTS] and node.extensions:
# Checking node.extensions is making sure that the type of lamp is managed, and will be exported
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"]
Expand Down

0 comments on commit 439b984

Please sign in to comment.