mirror of
https://github.com/QIDITECH/QIDISlicer.git
synced 2026-02-01 08:28:42 +03:00
update slic3r
This commit is contained in:
@@ -16,6 +16,8 @@
|
||||
#include "Gizmos/GLGizmoCut.hpp"
|
||||
#include "Gizmos/GLGizmoScale.hpp"
|
||||
|
||||
#include "libslic3r/MultipleBeds.hpp"
|
||||
|
||||
#include "OptionsGroup.hpp"
|
||||
#include "Tab.hpp"
|
||||
#include "wxExtensions.hpp"
|
||||
@@ -1828,6 +1830,9 @@ void ObjectList::load_mesh_object(const TriangleMesh &mesh, const std::string &n
|
||||
|
||||
new_object->ensure_on_bed();
|
||||
|
||||
if (! s_multiple_beds.get_loading_project_flag())
|
||||
new_object->instances.front()->set_offset(new_object->instances.front()->get_offset() + s_multiple_beds.get_bed_translation(s_multiple_beds.get_active_bed()));
|
||||
|
||||
#ifdef _DEBUG
|
||||
check_model_ids_validity(model);
|
||||
#endif /* _DEBUG */
|
||||
@@ -1914,13 +1919,20 @@ void ObjectList::del_info_item(const int obj_idx, InfoItemType type)
|
||||
}
|
||||
break;
|
||||
|
||||
case InfoItemType::MmuSegmentation:
|
||||
case InfoItemType::MmSegmentation:
|
||||
cnv->get_gizmos_manager().reset_all_states();
|
||||
Plater::TakeSnapshot(plater, _L("Remove Multi Material painting"));
|
||||
for (ModelVolume* mv : (*m_objects)[obj_idx]->volumes)
|
||||
mv->mm_segmentation_facets.reset();
|
||||
break;
|
||||
|
||||
case InfoItemType::FuzzySkin:
|
||||
cnv->get_gizmos_manager().reset_all_states();
|
||||
Plater::TakeSnapshot(plater, _L("Remove paint-on fuzzy skin"));
|
||||
for (ModelVolume* mv : (*m_objects)[obj_idx]->volumes)
|
||||
mv->fuzzy_skin_facets.reset();
|
||||
break;
|
||||
|
||||
case InfoItemType::Sinking:
|
||||
Plater::TakeSnapshot(plater, _L("Shift objects to bed"));
|
||||
(*m_objects)[obj_idx]->ensure_on_bed();
|
||||
@@ -2125,8 +2137,8 @@ void ObjectList::split()
|
||||
|
||||
take_snapshot(_(L("Split to Parts")));
|
||||
|
||||
// Before splitting volume we have to remove all custom supports, seams, and multimaterial painting.
|
||||
wxGetApp().plater()->clear_before_change_mesh(obj_idx, _u8L("Custom supports, seams and multimaterial painting were "
|
||||
// Before splitting volume we have to remove all custom supports, seams, fuzzy skin and multi-material painting.
|
||||
wxGetApp().plater()->clear_before_change_mesh(obj_idx, _u8L("Custom supports, seams, fuzzy skin and multi-material painting were "
|
||||
"removed after splitting the object."));
|
||||
|
||||
volume->split(nozzle_dmrs_cnt);
|
||||
@@ -2141,8 +2153,8 @@ void ObjectList::split()
|
||||
// update printable state for new volumes on canvas3D
|
||||
wxGetApp().plater()->canvas3D()->update_instance_printable_state_for_object(obj_idx);
|
||||
|
||||
// After removing custom supports, seams, and multimaterial painting, we have to update info about the object to remove information about
|
||||
// custom supports, seams, and multimaterial painting in the right panel.
|
||||
// After removing custom supports, seams, fuzzy skin, and multi-material painting, we have to update info about the object to remove information about
|
||||
// custom supports, seams, fuzzy skin, and multi-material painting in the right panel.
|
||||
wxGetApp().obj_list()->update_info_items(obj_idx);
|
||||
}
|
||||
|
||||
@@ -2515,7 +2527,7 @@ void ObjectList::invalidate_cut_info_for_object(int obj_idx)
|
||||
|
||||
take_snapshot(_L("Invalidate cut info"));
|
||||
|
||||
const CutObjectBase cut_id = init_obj->cut_id;
|
||||
const CutId cut_id = init_obj->cut_id;
|
||||
// invalidate cut for related objects (which have the same cut_id)
|
||||
for (size_t idx = 0; idx < m_objects->size(); idx++)
|
||||
if (ModelObject* obj = object(int(idx)); obj->cut_id.is_equal(cut_id)) {
|
||||
@@ -2545,7 +2557,7 @@ void ObjectList::delete_all_connectors_for_object(int obj_idx)
|
||||
|
||||
take_snapshot(_L("Delete all connectors"));
|
||||
|
||||
const CutObjectBase cut_id = init_obj->cut_id;
|
||||
const CutId cut_id = init_obj->cut_id;
|
||||
// Delete all connectors for related objects (which have the same cut_id)
|
||||
Model& model = wxGetApp().plater()->model();
|
||||
for (int idx = int(m_objects->size())-1; idx >= 0; idx--)
|
||||
@@ -2668,7 +2680,7 @@ void ObjectList::part_selection_changed()
|
||||
disable_ss_manipulation = (*m_objects)[obj_idx]->is_cut();
|
||||
}
|
||||
else if (selection.is_mixed() || selection.is_multiple_full_object()) {
|
||||
std::map<CutObjectBase, std::set<int>> cut_objects;
|
||||
std::map<CutId, std::set<int>> cut_objects;
|
||||
|
||||
// find cut objects
|
||||
for (auto item : sels) {
|
||||
@@ -2720,11 +2732,13 @@ void ObjectList::part_selection_changed()
|
||||
}
|
||||
case InfoItemType::CustomSupports:
|
||||
case InfoItemType::CustomSeam:
|
||||
case InfoItemType::MmuSegmentation:
|
||||
case InfoItemType::MmSegmentation:
|
||||
case InfoItemType::FuzzySkin:
|
||||
{
|
||||
GLGizmosManager::EType gizmo_type = info_type == InfoItemType::CustomSupports ? GLGizmosManager::EType::FdmSupports :
|
||||
info_type == InfoItemType::CustomSeam ? GLGizmosManager::EType::Seam :
|
||||
GLGizmosManager::EType::MmuSegmentation;
|
||||
info_type == InfoItemType::FuzzySkin ? GLGizmosManager::EType::FuzzySkin :
|
||||
GLGizmosManager::EType::MmSegmentation;
|
||||
if (gizmos_mgr.get_current_type() != gizmo_type)
|
||||
gizmos_mgr.open_gizmo(gizmo_type);
|
||||
break;
|
||||
@@ -2894,7 +2908,8 @@ void ObjectList::update_info_items(size_t obj_idx, wxDataViewItemArray* selectio
|
||||
for (InfoItemType type : {InfoItemType::CustomSupports,
|
||||
InfoItemType::CustomSeam,
|
||||
InfoItemType::CutConnectors,
|
||||
InfoItemType::MmuSegmentation,
|
||||
InfoItemType::MmSegmentation,
|
||||
InfoItemType::FuzzySkin,
|
||||
InfoItemType::Sinking,
|
||||
InfoItemType::VariableLayerHeight}) {
|
||||
wxDataViewItem item = m_objects_model->GetInfoItemByType(item_obj, type);
|
||||
@@ -2904,12 +2919,14 @@ void ObjectList::update_info_items(size_t obj_idx, wxDataViewItemArray* selectio
|
||||
switch (type) {
|
||||
case InfoItemType::CustomSupports :
|
||||
case InfoItemType::CustomSeam :
|
||||
case InfoItemType::MmuSegmentation :
|
||||
case InfoItemType::MmSegmentation :
|
||||
case InfoItemType::FuzzySkin :
|
||||
should_show = printer_technology() == ptFFF
|
||||
&& std::any_of(model_object->volumes.begin(), model_object->volumes.end(),
|
||||
[type](const ModelVolume *mv) {
|
||||
return !(type == InfoItemType::CustomSupports ? mv->supported_facets.empty() :
|
||||
type == InfoItemType::CustomSeam ? mv->seam_facets.empty() :
|
||||
type == InfoItemType::FuzzySkin ? mv->fuzzy_skin_facets.empty() :
|
||||
mv->mm_segmentation_facets.empty());
|
||||
});
|
||||
break;
|
||||
@@ -4634,7 +4651,7 @@ void ObjectList::fix_through_winsdk()
|
||||
msg += "\n";
|
||||
}
|
||||
|
||||
plater->clear_before_change_mesh(obj_idx, _u8L("Custom supports, seams and multimaterial painting were "
|
||||
plater->clear_before_change_mesh(obj_idx, _u8L("Custom supports, seams, fuzzy skin and multimaterial painting were "
|
||||
"removed after repairing the mesh."));
|
||||
std::string res;
|
||||
if (!fix_model_by_win10_sdk_gui(*(object(obj_idx)), vol_idx, progress_dlg, msg, res))
|
||||
@@ -4976,10 +4993,5 @@ ModelObject* ObjectList::object(const int obj_idx) const
|
||||
return (*m_objects)[obj_idx];
|
||||
}
|
||||
|
||||
bool ObjectList::has_paint_on_segmentation()
|
||||
{
|
||||
return m_objects_model->HasInfoItem(InfoItemType::MmuSegmentation);
|
||||
}
|
||||
|
||||
} //namespace GUI
|
||||
} //namespace Slic3r
|
||||
|
||||
Reference in New Issue
Block a user