glTF exporter: Take (new) light temperature into account

This commit is contained in:
Julien Duroure
2025-06-17 12:24:38 +02:00
parent 71275fc218
commit f9b3baa984
2 changed files with 12 additions and 2 deletions

View File

@@ -5,7 +5,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": (4, 5, 37),
"version": (4, 5, 38),
'blender': (4, 4, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',

View File

@@ -64,7 +64,17 @@ def __gather_color(blender_lamp, export_settings) -> Optional[List[float]]:
path_['path'] = "/extensions/KHR_lights_punctual/lights/XXX/color"
export_settings['current_paths']['color'] = path_
return list(blender_lamp.color)
color = blender_lamp.color
if blender_lamp.use_temperature:
temperature_color = blender_lamp.temperature_color
color[0] *= temperature_color
color[1] *= temperature_color
color[2] *= temperature_color
return list(color)
# TODO, check if temperature is animated, for KHR_animation_pointer
def __gather_intensity(blender_lamp, blender_lamp_world_matrix, export_settings) -> Optional[float]: