From 92822702958e7b2e0a28e19557381d9e5cb858bb Mon Sep 17 00:00:00 2001 From: Marc Gilleron Date: Sat, 9 Dec 2017 18:48:02 +0100 Subject: [PATCH] Update GIProbe data instead of creating a new one on bake --- scene/3d/gi_probe.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp index 8e2f87738a7..ff5cb411357 100644 --- a/scene/3d/gi_probe.cpp +++ b/scene/3d/gi_probe.cpp @@ -1284,8 +1284,11 @@ void GIProbe::bake(Node *p_from_node, bool p_create_visual_debug) { _create_debug_mesh(&baker); } else { - Ref probe_data; - probe_data.instance(); + Ref probe_data = get_probe_data(); + + if(probe_data.is_null()) + probe_data.instance(); + probe_data->set_bounds(AABB(-extents, extents * 2.0)); probe_data->set_cell_size(baker.po2_bounds.size[longest_axis] / baker.axis_cell_size[longest_axis]); probe_data->set_dynamic_data(data);