Edit mixed filaments and their gradients over MCP as the sidebar does

Agents can now read the whole filament list with filament_list, change a mixed filament with filament_edit_mixed,
and set a gradient by driving the Add or Edit Mixed Filament dialog. The slot colours and the flushing settings move
from the project tools to filament_set_colour and filament_set_flushing, beside the rest of the filament list.
Deleting or merging a filament that a mix uses now behaves as it does in the sidebar, and the settings tools no
longer edit a physical filament's preset through a mixed slot.
This commit is contained in:
SoftFever committed 2026-11-20 17:15:05 +08:00
1 parent 6afa573668
commit 190d6848b0
35 files changed
+1692 -557

No files matched your search

+10 -8
View File
@@ -173,7 +173,8 @@ const std::vector<std::pair<std::string, std::set<std::string>>> kPlaces{
{"preset_list", "preset_select", "preset_save", "preset_delete", "settings_list", "settings_get", "settings_set", "preset_import",
"preset_export", "preset_sync", "settings_set_mode", "preset_migrate_filaments", "settings_toggle_developer_mode"}},
{"Filaments",
{"filament_add", "filament_delete", "filament_sync_ams", "filament_add_mixed", "filament_install", "filament_uninstall"}},
{"filament_list", "filament_add", "filament_delete", "filament_sync_ams", "filament_add_mixed", "filament_edit_mixed",
"filament_set_colour", "filament_set_flushing", "filament_install", "filament_uninstall"}},
{"Printers and prints",
{"printer_send", "printer_list_models", "printer_install", "printer_uninstall", "print_start", "printer_test_host",
"printer_status", "print_pause", "print_resume", "print_stop"}},
@@ -452,9 +453,10 @@ TEST_CASE("outside the Design tab the catalog has its commands and 129 actions",
CHECK(c.action_group == section.at(c.key));
}
// The commands outside the Design tab: the typed tools, the commands made from menu items, the seven Parts 4a to 4c
// add, Part 5a's three, Part 5b's two, Part 5c's one, Part 5d's four, the seven gizmo commands and the six printing
// commands.
CHECK(commands == 131);
// add, Part 5a's three, Part 5b's two, Part 5c's one, Part 5d's four, the seven gizmo commands, the six printing
// commands and the four of the filament list (filament_list, filament_edit_mixed, filament_set_colour and
// filament_set_flushing).
CHECK(commands == 135);
// The eight commands named as their menu items keep an action of their own; the other 121 actions are items.
CHECK(own == std::set<std::string>{"plate_add", "plate_delete", "plate_duplicate", "plate_rename", "filament_add", "filament_delete",
"undo", "redo"});
@@ -481,7 +483,7 @@ TEST_CASE("the commands outside the Design tab are the design's, under its headi
commands += keys.size();
}
CHECK(by_heading.size() == kPlaces.size());
CHECK(commands == 131);
CHECK(commands == 135);
// tool_search's group says which there are.
const NativeCommand* search = NativeCommands::find("tool_search");
@@ -522,8 +524,8 @@ TEST_CASE("every command that runs from arguments is in the tool list, by place"
// The three menu items with no argument form, which tool_search finds and tool_call runs.
CHECK(unlisted == std::set<std::string>{"window_save_screenshot", "script_toggle_panel", "settings_toggle_developer_mode"});
// Task 3's 98, the seven Parts 4a to 4c add, Part 5a's three, Part 5b's two, Part 5c's one, Part 5d's four, the
// seven gizmo commands and the six printing commands.
CHECK(listed.size() == 128);
// seven gizmo commands, the six printing commands and the filament list's four.
CHECK(listed.size() == 132);
// The search, the generic call and the app's state first; then each heading's commands together, in the
// design's order, Driving the GUI last.
@@ -553,7 +555,7 @@ TEST_CASE("only deleting a preset, uninstalling a plugin and stopping a print ar
"plate_get_settings", "project_get_settings", "plate_list", "object_list",
"window_screenshot", "plate_slice_stats", "script_search_api", "action_search",
"window_list", "widget_list", "printer_list_models", "plugin_list",
"printer_status"};
"printer_status", "filament_list"};
// The commands made from menu items whose item reaches a printer, the cloud account or the network.
const std::set<std::string> menu_items_reaching_out{"printer_send", "preset_sync", "filament_sync_ams",
"app_check_for_updates", "app_open_web_page", "plugin_refresh"};