Update extruder show/hide and default extruder color in respect to the volume type

This commit is contained in:
YuSanka 2021-05-28 13:02:18 +02:00
parent 0a6490bab9
commit 8e1cde43a6
9 changed files with 133 additions and 77 deletions

View file

@ -665,6 +665,12 @@ void MenuFactory::append_menu_item_change_extruder(wxMenu* menu)
if (sels.IsEmpty())
return;
if (sels.Count() == 1) {
const auto sel_vol = obj_list()->get_selected_model_volume();
if (sel_vol && sel_vol->type() != ModelVolumeType::MODEL_PART && sel_vol->type() != ModelVolumeType::PARAMETER_MODIFIER)
return;
}
std::vector<wxBitmap*> icons = get_extruder_color_icons(true);
wxMenu* extruder_selection_menu = new wxMenu();
const wxString& name = sels.Count() == 1 ? names[0] : names[1];