summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-12-09 14:54:50 -0300
committerGitHub <noreply@github.com>2017-12-09 14:54:50 -0300
commit8a4cec21ca5297d8a0cc9082f86ba12bec1e0915 (patch)
treebefae2201d78c2960d8f16e26306c1ee4847ce76
parent690c05e6c25174613feebfe70d49c53874fb1b10 (diff)
parent92822702958e7b2e0a28e19557381d9e5cb858bb (diff)
Merge pull request #14460 from Zylann/giprobe_update_resource
Update GIProbe data instead of creating a new one on bake
-rw-r--r--scene/3d/gi_probe.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/scene/3d/gi_probe.cpp b/scene/3d/gi_probe.cpp
index 8e2f87738a..ff5cb41135 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<GIProbeData> probe_data;
- probe_data.instance();
+ Ref<GIProbeData> 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);