Allow specifying print order within each layer (#3685)

* Allow reordering objects regardless of print seq

* Add option to control the layer print order

* Sort object by their order in object list instead of id

* Show print order when print order is the same as the object list

* Ensure the print order when print order is same as object list

* Update option name

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
Noisyfox 2024-01-21 20:11:09 +08:00 committed by GitHub
parent e92be73894
commit 26505e23ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 54 additions and 28 deletions

View file

@ -1545,26 +1545,6 @@ void ObjectList::OnBeginDrag(wxDataViewEvent &event)
}
if (type & itObject) {
int curr_obj_id = m_objects_model->GetIdByItem(event.GetItem());
PartPlateList& partplate_list = wxGetApp().plater()->get_partplate_list();
int from_plate = partplate_list.find_instance(curr_obj_id, 0);
if (from_plate == -1) {
event.Veto();
return;
}
auto curr_plate_seq = partplate_list.get_plate(from_plate)->get_print_seq();
if (curr_plate_seq == PrintSequence::ByDefault) {
auto curr_preset_config = wxGetApp().preset_bundle->prints.get_edited_preset().config;
if (curr_preset_config.has("print_sequence"))
curr_plate_seq = curr_preset_config.option<ConfigOptionEnum<PrintSequence>>("print_sequence")->value;
}
if (curr_plate_seq != PrintSequence::ByObject) {
//drag forbidden under bylayer mode
event.Veto();
return;
}
m_dragged_data.init(m_objects_model->GetIdByItem(item), type);
}
else if (type & itVolume){