1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-17 14:11:06 +00:00

Fix editor getting stuck after baking lightmaps from a script

This commit is contained in:
JFonS
2021-09-11 20:41:32 +02:00
parent 95162ca393
commit 14eb739418
4 changed files with 19 additions and 4 deletions

View File

@@ -33,15 +33,12 @@
void BakedLightmapEditorPlugin::_bake_select_file(const String &p_file) {
if (lightmap) {
BakedLightmap::BakeError err;
uint32_t time_started = OS::get_singleton()->get_ticks_msec();
if (get_tree()->get_edited_scene_root() && get_tree()->get_edited_scene_root() == lightmap) {
err = lightmap->bake(lightmap, p_file);
} else {
err = lightmap->bake(lightmap->get_parent(), p_file);
}
bake_func_end(time_started);
switch (err) {
case BakedLightmap::BAKE_ERROR_NO_SAVE_PATH: {
String scene_path = lightmap->get_filename();
@@ -173,6 +170,7 @@ BakedLightmapEditorPlugin::BakedLightmapEditorPlugin(EditorNode *p_node) {
BakedLightmap::bake_step_function = bake_func_step;
BakedLightmap::bake_substep_function = bake_func_substep;
BakedLightmap::bake_end_function = bake_func_end;
}
BakedLightmapEditorPlugin::~BakedLightmapEditorPlugin() {