From ea4e9b35a3e2084325fbaed4c5bedf310bcdef3e Mon Sep 17 00:00:00 2001 From: YuSanka Date: Fri, 20 Aug 2021 09:26:39 +0200 Subject: [PATCH] Fix for #6803 - Illegal character in filename when STL opened direct from CAD app --- src/slic3r/GUI/Plater.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Plater.cpp b/src/slic3r/GUI/Plater.cpp index 0c3c5b9b1..ce4845fed 100644 --- a/src/slic3r/GUI/Plater.cpp +++ b/src/slic3r/GUI/Plater.cpp @@ -2334,7 +2334,9 @@ std::vector Plater::priv::load_files(const std::vector& input_ else { model = Slic3r::Model::read_from_file(path.string(), nullptr, nullptr, only_if(load_config, Model::LoadAttribute::CheckVersion)); for (auto obj : model.objects) - if (obj->name.empty()) + if (obj->name.empty() || + obj->name.find_first_of("/") != std::string::npos) // When file is imported from Fusion360 the path containes "/" instead of "\\" (see https://github.com/prusa3d/PrusaSlicer/issues/6803) + // But read_from_file doesn't support that direction separator and as a result object name containes full path obj->name = fs::path(obj->input_file).filename().string(); } } catch (const ConfigurationError &e) {