From 8e8d2e7aecc4651f2d1ab36acb9632070f72e535 Mon Sep 17 00:00:00 2001 From: Aras Pranckevicius Date: Thu, 22 May 2025 20:31:56 +0200 Subject: [PATCH] Fix: Make new FBX importer support Light exposure 7e0dad0580124 added Light exposure import to Python FBX importer, but not to the new C++ one Pull Request: https://projects.blender.org/blender/blender/pulls/139292 --- source/blender/io/fbx/importer/fbx_import.cc | 1 + tests/python/modules/io_report.py | 10 +++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/source/blender/io/fbx/importer/fbx_import.cc b/source/blender/io/fbx/importer/fbx_import.cc index 331ffc3a5e7..80572d73eb4 100644 --- a/source/blender/io/fbx/importer/fbx_import.cc +++ b/source/blender/io/fbx/importer/fbx_import.cc @@ -216,6 +216,7 @@ void FbxImportContext::import_lights() lamp->g = flight->color.y; lamp->b = flight->color.z; lamp->energy = flight->intensity; + lamp->exposure = ufbx_find_real(&flight->props, "Exposure", 0.0); if (flight->cast_shadows) { lamp->mode |= LA_SHADOW; } diff --git a/tests/python/modules/io_report.py b/tests/python/modules/io_report.py index ede77b2a45c..fcd5cea1cd9 100644 --- a/tests/python/modules/io_report.py +++ b/tests/python/modules/io_report.py @@ -563,7 +563,15 @@ class Report: desc.write(f"==== Lights: {len(bpy.data.lights)}\n") for light in bpy.data.lights: desc.write( - f"- Light '{light.name}' {light.type} col:({light.color[0]:.3f}, {light.color[1]:.3f}, {light.color[2]:.3f}) energy:{light.energy:.3f}\n") + f"- Light '{light.name}' {light.type} col:({light.color[0]:.3f}, {light.color[1]:.3f}, {light.color[2]:.3f}) energy:{light.energy:.3f}") + if light.exposure != 0: + desc.write(f" exposure:{fmtf(light.exposure)}") + if light.use_temperature: + desc.write( + f" temp:{fmtf(light.temperature)}") + if not light.normalize: + desc.write(f" normalize_off") + desc.write(f"\n") if isinstance(light, bpy.types.SpotLight): desc.write(f" - spot {light.spot_size:.3f} blend {light.spot_blend:.3f}\n") Report._write_animdata_desc(light.animation_data, desc)