diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 58fbd531f8..049c81fe05 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -11453,6 +11453,13 @@ static std::vector> reloadable_volumes(const Model &model, c } return ret; } + +static bool source_filenames_equal(const std::string &lhs, const std::string &rhs) +{ + if (lhs.empty() || rhs.empty()) + return false; + return boost::algorithm::iequals(fs::path(lhs).filename().string(), fs::path(rhs).filename().string()); +} #endif // ENABLE_RELOAD_FROM_DISK_REWORK void Plater::priv::reload_from_disk() @@ -11710,7 +11717,8 @@ void Plater::priv::reload_from_disk() if (has_source && old_volume->source.object_idx < int(new_model.objects.size())) { const ModelObject *obj = new_model.objects[old_volume->source.object_idx]; if (old_volume->source.volume_idx < int(obj->volumes.size())) { - if (obj->volumes[old_volume->source.volume_idx]->source.input_file == old_volume->source.input_file) { + const std::string &loaded_src = obj->volumes[old_volume->source.volume_idx]->source.input_file; + if (source_filenames_equal(loaded_src, old_volume->source.input_file)) { new_volume_idx = old_volume->source.volume_idx; new_object_idx = old_volume->source.object_idx; match_found = true; @@ -11718,7 +11726,9 @@ void Plater::priv::reload_from_disk() } } - if (!match_found && has_name) { + // Search the loaded model by part name. Do not require the volume + // name to equal the source filename (Roller != tpu_tube-Roller.3mf). + if (!match_found && !old_volume->name.empty()) { // take idxs from the 1st matching volume for (size_t o = 0; o < new_model.objects.size(); ++o) { ModelObject *obj = new_model.objects[o];