summaryrefslogtreecommitdiffstats
path: root/editor/editor_file_system.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-07-19 17:31:39 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-07-19 17:31:39 +0200
commit50eee001803174d8f5315e26272b45f4de615683 (patch)
treee82ddf40aa9d6bbf1e6cbc158533d5d49b34aacf /editor/editor_file_system.cpp
parentf135f729b91e61e6844159a535a7474335ec8d52 (diff)
parent66822a8948e623d4bec91c433f58c4b54fe9086d (diff)
downloadredot-engine-50eee001803174d8f5315e26272b45f4de615683.tar.gz
Merge pull request #94093 from Yahkub-R/94056-fix
Fix instanced .blend/GLTF scenes lose all children after update until .tscn is reopened
Diffstat (limited to 'editor/editor_file_system.cpp')
-rw-r--r--editor/editor_file_system.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/editor/editor_file_system.cpp b/editor/editor_file_system.cpp
index 54a28d9cb1..a163833e50 100644
--- a/editor/editor_file_system.cpp
+++ b/editor/editor_file_system.cpp
@@ -2603,11 +2603,15 @@ void EditorFileSystem::_find_group_files(EditorFileSystemDirectory *efd, HashMap
}
void EditorFileSystem::reimport_file_with_custom_parameters(const String &p_file, const String &p_importer, const HashMap<StringName, Variant> &p_custom_params) {
+ Vector<String> reloads;
+ reloads.append(p_file);
+
+ // Emit the resource_reimporting signal for the single file before the actual importation.
+ emit_signal(SNAME("resources_reimporting"), reloads);
+
_reimport_file(p_file, p_custom_params, p_importer);
// Emit the resource_reimported signal for the single file we just reimported.
- Vector<String> reloads;
- reloads.append(p_file);
emit_signal(SNAME("resources_reimported"), reloads);
}
@@ -2669,6 +2673,9 @@ void EditorFileSystem::reimport_files(const Vector<String> &p_files) {
reimport_files.sort();
+ // Emit the resource_reimporting signal for the single file before the actual importation.
+ emit_signal(SNAME("resources_reimporting"), reloads);
+
#ifdef THREADS_ENABLED
bool use_multiple_threads = GLOBAL_GET("editor/import/use_multiple_threads");
#else
@@ -2763,11 +2770,15 @@ void EditorFileSystem::reimport_files(const Vector<String> &p_files) {
Error EditorFileSystem::reimport_append(const String &p_file, const HashMap<StringName, Variant> &p_custom_options, const String &p_custom_importer, Variant p_generator_parameters) {
ERR_FAIL_COND_V_MSG(!importing, ERR_INVALID_PARAMETER, "Can only append files to import during a current reimport process.");
+ Vector<String> reloads;
+ reloads.append(p_file);
+
+ // Emit the resource_reimporting signal for the single file before the actual importation.
+ emit_signal(SNAME("resources_reimporting"), reloads);
+
Error ret = _reimport_file(p_file, p_custom_options, p_custom_importer, &p_generator_parameters);
// Emit the resource_reimported signal for the single file we just reimported.
- Vector<String> reloads;
- reloads.append(p_file);
emit_signal(SNAME("resources_reimported"), reloads);
return ret;
}
@@ -2967,6 +2978,7 @@ void EditorFileSystem::_bind_methods() {
ADD_SIGNAL(MethodInfo("filesystem_changed"));
ADD_SIGNAL(MethodInfo("script_classes_updated"));
ADD_SIGNAL(MethodInfo("sources_changed", PropertyInfo(Variant::BOOL, "exist")));
+ ADD_SIGNAL(MethodInfo("resources_reimporting", PropertyInfo(Variant::PACKED_STRING_ARRAY, "resources")));
ADD_SIGNAL(MethodInfo("resources_reimported", PropertyInfo(Variant::PACKED_STRING_ARRAY, "resources")));
ADD_SIGNAL(MethodInfo("resources_reload", PropertyInfo(Variant::PACKED_STRING_ARRAY, "resources")));
}