From 780d22597aec296bb78b6bbb1bb6d9cc8b077e5e Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 25 Nov 2024 13:19:25 +1100 Subject: [PATCH] Fix #130705: importing/exporting FBX with lights fails --- scripts/addons_core/io_scene_fbx/export_fbx_bin.py | 3 ++- scripts/addons_core/io_scene_fbx/import_fbx.py | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/addons_core/io_scene_fbx/export_fbx_bin.py b/scripts/addons_core/io_scene_fbx/export_fbx_bin.py index 1e23742a081..9a0aceb99fe 100644 --- a/scripts/addons_core/io_scene_fbx/export_fbx_bin.py +++ b/scripts/addons_core/io_scene_fbx/export_fbx_bin.py @@ -588,11 +588,12 @@ def fbx_data_light_elements(root, lamp, scene_data): light_key = scene_data.data_lights[lamp] do_light = True do_shadow = False + # NOTE: this was removed from lamps, always write black. shadow_color = Vector((0.0, 0.0, 0.0)) if lamp.type not in {'HEMI'}: do_light = True do_shadow = lamp.use_shadow - shadow_color = lamp.shadow_color + # `shadow_color = lamp.shadow_color`: now removed. light = elem_data_single_int64(root, b"NodeAttribute", get_fbx_uuid_from_key(light_key)) light.add_string(fbx_name_class(lamp.name.encode(), b"NodeAttribute")) diff --git a/scripts/addons_core/io_scene_fbx/import_fbx.py b/scripts/addons_core/io_scene_fbx/import_fbx.py index 00c407cfba9..28bab042cf5 100644 --- a/scripts/addons_core/io_scene_fbx/import_fbx.py +++ b/scripts/addons_core/io_scene_fbx/import_fbx.py @@ -2233,8 +2233,8 @@ def blen_read_light(fbx_tmpl, fbx_obj, settings): lamp.use_shadow = elem_props_get_bool(fbx_props, b'CastShadow', True) if hasattr(lamp, "cycles"): lamp.cycles.cast_shadow = lamp.use_shadow - # Keeping this for now, but this is not used nor exposed anymore afaik... - lamp.shadow_color = elem_props_get_color_rgb(fbx_props, b'ShadowColor', (0.0, 0.0, 0.0)) + # Removed but could be restored if the value can be applied. + # `lamp.shadow_color = elem_props_get_color_rgb(fbx_props, b'ShadowColor', (0.0, 0.0, 0.0))` if settings.use_custom_props: blen_read_custom_properties(fbx_obj, lamp, settings)