mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-12 18:31:18 +00:00
Fix loading a multi-toolhead 3MF that has no filament_self_index (#16331)
This commit is contained in:
@@ -5888,6 +5888,21 @@ TEST_CASE("A project saved with pressure advance per filament applies it to ever
|
||||
check_double_vector(petg.opt<ConfigOptionFloatsNullable>("filament_flow_ratio")->values, { 0.97 });
|
||||
}
|
||||
|
||||
TEST_CASE("A multi-toolhead project saved without filament self indices loads every filament", "[Preset][Bundle]")
|
||||
{
|
||||
const std::vector<std::string> colors = { "#FF0000", "#000000", "#FFFFFF", "#FFFF00" };
|
||||
DynamicPrintConfig config = DynamicPrintConfig::full_print_config();
|
||||
config.opt<ConfigOptionStrings>("filament_colour")->values = colors;
|
||||
config.opt<ConfigOptionFloats>("nozzle_diameter")->values = std::vector<double>(colors.size(), 0.4);
|
||||
config.option<ConfigOptionBool>("single_extruder_multi_material")->value = false;
|
||||
Preset::normalize(config);
|
||||
|
||||
PresetBundle bundle;
|
||||
REQUIRE_NOTHROW(bundle.load_config_model("test.3mf", std::move(config)));
|
||||
CHECK(bundle.filament_presets.size() == colors.size());
|
||||
CHECK(bundle.project_config.opt<ConfigOptionStrings>("filament_colour")->values == colors);
|
||||
}
|
||||
|
||||
TEST_CASE("A system preset resolves by name from the bundled profiles", "[Preset][Bundle]")
|
||||
{
|
||||
ScopedTemporaryDir temp_dir;
|
||||
|
||||
Reference in New Issue
Block a user