From 630c6653dfeec5753cd9e2cbeb594f2dbbc50ba9 Mon Sep 17 00:00:00 2001 From: goofoo Date: Tue, 2 Jun 2026 09:22:05 -0400 Subject: [PATCH] fix(#413): use raw filament_type in sw_GetFileFilamentMapping to prevent PLA-S remapping get_filament_type() remaps 'Generic Support For PLA' to 'PLA-S' for display purposes. Using it in sw_GetFileFilamentMapping caused the web UI filament matcher to fail for support filaments because the raw type value was expected. Use filament_type_opt->get_at() directly to read the stored filament type without the display remapping. --- src/slic3r/GUI/SSWCP.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/slic3r/GUI/SSWCP.cpp b/src/slic3r/GUI/SSWCP.cpp index e5d59d474dc..e2fa58b1781 100644 --- a/src/slic3r/GUI/SSWCP.cpp +++ b/src/slic3r/GUI/SSWCP.cpp @@ -3205,15 +3205,17 @@ void SSWCP_MachineOption_Instance::sw_GetFileFilamentMapping() // filament type if (full_config.has("filament_type")) { std::vector filament_types; - size_t filament_count = full_config.option("filament_type")->values.size(); + const auto* filament_type_opt = full_config.option("filament_type"); + size_t filament_count = filament_type_opt->values.size(); if (full_config.has("filament_colour")) { filament_count = std::max(filament_count, full_config.option("filament_colour")->values.size()); } filament_types.reserve(filament_count); for (size_t i = 0; i < filament_count; ++i) { - std::string displayed_filament_type; - std::string filament_type = full_config.get_filament_type(displayed_filament_type, int(i)); + // Use raw filament_type value to avoid get_filament_type() remapping + // "Generic Support For PLA" -> "PLA-S", which breaks filament matching in the web UI. + std::string filament_type = filament_type_opt->get_at(int(i)); boost::trim(filament_type); filament_types.emplace_back(std::move(filament_type)); }