From 2e8334fa001f38b222ca0759ba614efd37e30f7f Mon Sep 17 00:00:00 2001 From: Mack <86566939+Macksaur@users.noreply.github.com> Date: Mon, 24 Jan 2022 06:59:48 +0000 Subject: [PATCH] Fixed accessing a null MeshInstance object in BakedLightmap instead of the GeometryInstance (cherry picked from commit 36c7110c1b9473d8c5af03d035df21dec05f513c) --- scene/3d/baked_lightmap.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scene/3d/baked_lightmap.cpp b/scene/3d/baked_lightmap.cpp index 293a4043c43..a8cc211bb1f 100644 --- a/scene/3d/baked_lightmap.cpp +++ b/scene/3d/baked_lightmap.cpp @@ -389,7 +389,7 @@ void BakedLightmap::_find_meshes_and_lights(Node *p_at_node, Vector GeometryInstance *gi = Object::cast_to(p_at_node); if (gi) { - all_override = mi->get_material_override(); + all_override = gi->get_material_override(); } for (int i = 0; i < bmeshes.size(); i += 2) { @@ -414,8 +414,8 @@ void BakedLightmap::_find_meshes_and_lights(Node *p_at_node, Vector mf.mesh = mesh; if (gi) { - mf.cast_shadows = mi->get_cast_shadows_setting() != GeometryInstance::SHADOW_CASTING_SETTING_OFF; - mf.generate_lightmap = mi->get_generate_lightmap(); + mf.cast_shadows = gi->get_cast_shadows_setting() != GeometryInstance::SHADOW_CASTING_SETTING_OFF; + mf.generate_lightmap = gi->get_generate_lightmap(); } else { mf.cast_shadows = true; mf.generate_lightmap = true;