diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2016-07-26 07:17:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-26 07:17:48 +0200 |
commit | bc6e750f957864d866bad94236212d1a87cebd2d (patch) | |
tree | 316b73e64d4ce0f324f190c56ccda29b9438e929 /tools/editor/plugins | |
parent | 6273ec901faec2823c8f4801244d1cffbbe9b118 (diff) | |
parent | 213a57ccafdf2f4fcc472801c60332d40cfe6464 (diff) |
Merge pull request #5913 from djrm/fix_bake_segfault
Stop baking process if there is no geometry in the BakedLightInstance.
Diffstat (limited to 'tools/editor/plugins')
-rw-r--r-- | tools/editor/plugins/baked_light_baker.cpp | 4 | ||||
-rw-r--r-- | tools/editor/plugins/baked_light_editor_plugin.cpp | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/tools/editor/plugins/baked_light_baker.cpp b/tools/editor/plugins/baked_light_baker.cpp index 6a88ba4cbe..a2e94e8855 100644 --- a/tools/editor/plugins/baked_light_baker.cpp +++ b/tools/editor/plugins/baked_light_baker.cpp @@ -1772,6 +1772,10 @@ void BakedLightBaker::bake(const Ref<BakedLight> &p_light, Node* p_node) { mat_map.clear(); tex_map.clear(); print_line("\ttotal triangles: "+itos(triangles.size())); + // no geometry + if (triangles.size() == 0) { + return; + } ep.step(TTR("Fixing Lights"),1); _fix_lights(); ep.step(TTR("Making BVH"),2); diff --git a/tools/editor/plugins/baked_light_editor_plugin.cpp b/tools/editor/plugins/baked_light_editor_plugin.cpp index df76f28ae0..a58a0c25e2 100644 --- a/tools/editor/plugins/baked_light_editor_plugin.cpp +++ b/tools/editor/plugins/baked_light_editor_plugin.cpp @@ -206,8 +206,9 @@ void BakedLightEditor::_menu_option(int p_option) { void BakedLightEditor::_bake_pressed() { ERR_FAIL_COND(!node); - if (node->get_baked_light().is_null()) { - err_dialog->set_text(TTR("BakedLightInstance does not contain a BakedLight resource.")); + const String conf_warning = node->get_configuration_warning(); + if (!conf_warning.empty()) { + err_dialog->set_text(conf_warning); err_dialog->popup_centered_minsize(); button_bake->set_pressed(false); return; @@ -236,6 +237,7 @@ void BakedLightEditor::_bake_pressed() { update_timeout=0; last_rays_time=0; + button_bake->set_pressed(false); set_process(true); } |