1
0
Fork 0

Merge pull request #101853 from jamesmintram/jamesrm/lightmapgi-crash-fix

Fix a crash bug in `LightmapGI::_assign_lightmaps` triggered after reparenting
This commit is contained in:
Thaddeus Crews 2025-02-05 10:27:28 -06:00
commit 819874bd7f
No known key found for this signature in database
GPG Key ID: 62181B86FE9E5D84
2 changed files with 7 additions and 0 deletions

View File

@ -1491,11 +1491,17 @@ void LightmapGI::_notification(int p_what) {
"%s (%s): The directional lightmap textures are stored in a format that isn't supported anymore. Please bake lightmaps again to make lightmaps display from this node again.",
get_light_data()->get_path(), get_name()));
if (last_owner && last_owner != get_owner()) {
light_data->clear_users();
}
_assign_lightmaps();
}
} break;
case NOTIFICATION_EXIT_TREE: {
last_owner = get_owner();
if (light_data.is_valid()) {
_clear_lightmaps();
}

View File

@ -206,6 +206,7 @@ private:
Ref<CameraAttributes> camera_attributes;
Ref<LightmapGIData> light_data;
Node *last_owner = nullptr;
struct LightsFound {
Transform3D xform;