summaryrefslogtreecommitdiff
path: root/tools/editor/io_plugins
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2016-06-28 18:53:31 -0300
committerJuan Linietsky <reduzio@gmail.com>2016-06-28 18:53:31 -0300
commitfbdb7a947bd9d75ed6e2a86e58337ca4d47d085e (patch)
treefaf271513a2ac273def1753fb4e00e88c3945f12 /tools/editor/io_plugins
parent5065e46381814746eeddb4c44b5eb1540b0331f8 (diff)
Editor properly reloads scenes if they changed on disk or were reimported
Diffstat (limited to 'tools/editor/io_plugins')
-rw-r--r--tools/editor/io_plugins/editor_scene_import_plugin.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.cpp b/tools/editor/io_plugins/editor_scene_import_plugin.cpp
index d5d0fac2b6..b27539b933 100644
--- a/tools/editor/io_plugins/editor_scene_import_plugin.cpp
+++ b/tools/editor/io_plugins/editor_scene_import_plugin.cpp
@@ -2790,15 +2790,16 @@ Error EditorSceneImportPlugin::import2(Node *scene, const String& p_dest_path, c
Ref<PackedScene> packer = memnew( PackedScene );
packer->pack(scene);
- packer->set_path(p_dest_path);
+ //packer->set_path(p_dest_path); do not take over, let the changed files reload themselves
packer->set_import_metadata(from);
print_line("SAVING TO: "+p_dest_path);
- err = ResourceSaver::save(p_dest_path,packer,ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS);
+ err = ResourceSaver::save(p_dest_path,packer); //do not take over, let the changed files reload themselves
//EditorFileSystem::get_singleton()->update_resource(packer);
memdelete(scene);
+
/*
scene->set_filename(p_dest_path);
if (r_scene) {
@@ -2818,6 +2819,7 @@ Error EditorSceneImportPlugin::import2(Node *scene, const String& p_dest_path, c
*/
+ EditorNode::get_singleton()->reload_scene(p_dest_path);
return err;