mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 09:17:52 -06:00
Merge remote-tracking branch 'remotes/origin/ys_bugfixing'
This commit is contained in:
commit
a892fa6105
7 changed files with 54 additions and 7 deletions
|
@ -1208,6 +1208,7 @@ wxDEFINE_EVENT(EVT_GLCANVAS_MOUSE_DRAGGING_FINISHED, SimpleEvent);
|
||||||
wxDEFINE_EVENT(EVT_GLCANVAS_UPDATE_BED_SHAPE, SimpleEvent);
|
wxDEFINE_EVENT(EVT_GLCANVAS_UPDATE_BED_SHAPE, SimpleEvent);
|
||||||
wxDEFINE_EVENT(EVT_GLCANVAS_TAB, SimpleEvent);
|
wxDEFINE_EVENT(EVT_GLCANVAS_TAB, SimpleEvent);
|
||||||
wxDEFINE_EVENT(EVT_GLCANVAS_RESETGIZMOS, SimpleEvent);
|
wxDEFINE_EVENT(EVT_GLCANVAS_RESETGIZMOS, SimpleEvent);
|
||||||
|
wxDEFINE_EVENT(EVT_GLCANVAS_MOVE_DOUBLE_SLIDER, wxKeyEvent);
|
||||||
|
|
||||||
GLCanvas3D::GLCanvas3D(wxGLCanvas* canvas, Bed3D& bed, Camera& camera, GLToolbar& view_toolbar)
|
GLCanvas3D::GLCanvas3D(wxGLCanvas* canvas, Bed3D& bed, Camera& camera, GLToolbar& view_toolbar)
|
||||||
: m_canvas(canvas)
|
: m_canvas(canvas)
|
||||||
|
@ -2467,6 +2468,20 @@ void GLCanvas3D::on_key(wxKeyEvent& evt)
|
||||||
}
|
}
|
||||||
else if (keyCode == WXK_CONTROL)
|
else if (keyCode == WXK_CONTROL)
|
||||||
m_dirty = true;
|
m_dirty = true;
|
||||||
|
// DoubleSlider navigation in Preview
|
||||||
|
else if (keyCode == WXK_LEFT ||
|
||||||
|
keyCode == WXK_RIGHT ||
|
||||||
|
keyCode == WXK_UP ||
|
||||||
|
keyCode == WXK_DOWN ||
|
||||||
|
keyCode == '+' ||
|
||||||
|
keyCode == WXK_NUMPAD_ADD ||
|
||||||
|
keyCode == '-' ||
|
||||||
|
keyCode == 390 ||
|
||||||
|
keyCode == WXK_DELETE ||
|
||||||
|
keyCode == WXK_BACK )
|
||||||
|
{
|
||||||
|
post_event(wxKeyEvent(EVT_GLCANVAS_MOVE_DOUBLE_SLIDER, evt));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,6 +124,7 @@ wxDECLARE_EVENT(EVT_GLCANVAS_MOUSE_DRAGGING_FINISHED, SimpleEvent);
|
||||||
wxDECLARE_EVENT(EVT_GLCANVAS_UPDATE_BED_SHAPE, SimpleEvent);
|
wxDECLARE_EVENT(EVT_GLCANVAS_UPDATE_BED_SHAPE, SimpleEvent);
|
||||||
wxDECLARE_EVENT(EVT_GLCANVAS_TAB, SimpleEvent);
|
wxDECLARE_EVENT(EVT_GLCANVAS_TAB, SimpleEvent);
|
||||||
wxDECLARE_EVENT(EVT_GLCANVAS_RESETGIZMOS, SimpleEvent);
|
wxDECLARE_EVENT(EVT_GLCANVAS_RESETGIZMOS, SimpleEvent);
|
||||||
|
wxDECLARE_EVENT(EVT_GLCANVAS_MOVE_DOUBLE_SLIDER, wxKeyEvent);
|
||||||
|
|
||||||
class GLCanvas3D
|
class GLCanvas3D
|
||||||
{
|
{
|
||||||
|
|
|
@ -1415,13 +1415,18 @@ void ObjectList::update_opt_keys(t_config_option_keys& opt_keys)
|
||||||
|
|
||||||
void ObjectList::load_subobject(ModelVolumeType type)
|
void ObjectList::load_subobject(ModelVolumeType type)
|
||||||
{
|
{
|
||||||
auto item = GetSelection();
|
wxDataViewItem item = GetSelection();
|
||||||
if (!item || m_objects_model->GetParent(item) != wxDataViewItem(0))
|
// we can add volumes for Object or Instance
|
||||||
|
if (!item || !(m_objects_model->GetItemType(item)&(itObject|itInstance)))
|
||||||
return;
|
return;
|
||||||
int obj_idx = m_objects_model->GetIdByItem(item);
|
const int obj_idx = m_objects_model->GetObjectIdByItem(item);
|
||||||
|
|
||||||
if (obj_idx < 0) return;
|
if (obj_idx < 0) return;
|
||||||
|
|
||||||
|
// Get object item, if Instance is selected
|
||||||
|
if (m_objects_model->GetItemType(item)&itInstance)
|
||||||
|
item = m_objects_model->GetItemById(obj_idx);
|
||||||
|
|
||||||
std::vector<std::pair<wxString, bool>> volumes_info;
|
std::vector<std::pair<wxString, bool>> volumes_info;
|
||||||
load_part((*m_objects)[obj_idx], volumes_info, type);
|
load_part((*m_objects)[obj_idx], volumes_info, type);
|
||||||
|
|
||||||
|
@ -2150,9 +2155,11 @@ void ObjectList::update_selections()
|
||||||
if (GetSelectedItemsCount() == 1 && m_objects_model->GetItemType(GetSelection()) == itSettings )
|
if (GetSelectedItemsCount() == 1 && m_objects_model->GetItemType(GetSelection()) == itSettings )
|
||||||
{
|
{
|
||||||
const auto item = GetSelection();
|
const auto item = GetSelection();
|
||||||
if (selection.is_single_full_object() &&
|
if (selection.is_single_full_object()) {
|
||||||
m_objects_model->GetIdByItem(m_objects_model->GetParent(item)) == selection.get_object_idx())
|
if ( m_objects_model->GetIdByItem(m_objects_model->GetParent(item)) == selection.get_object_idx())
|
||||||
return;
|
return;
|
||||||
|
sels.Add(m_objects_model->GetItemById(selection.get_object_idx()));
|
||||||
|
}
|
||||||
if (selection.is_single_volume() || selection.is_any_modifier()) {
|
if (selection.is_single_volume() || selection.is_any_modifier()) {
|
||||||
const auto gl_vol = selection.get_volume(*selection.get_volume_idxs().begin());
|
const auto gl_vol = selection.get_volume(*selection.get_volume_idxs().begin());
|
||||||
if (m_objects_model->GetVolumeIdByItem(m_objects_model->GetParent(item)) == gl_vol->volume_idx())
|
if (m_objects_model->GetVolumeIdByItem(m_objects_model->GetParent(item)) == gl_vol->volume_idx())
|
||||||
|
|
|
@ -414,6 +414,12 @@ void Preview::msw_rescale()
|
||||||
refresh_print();
|
refresh_print();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Preview::move_double_slider(wxKeyEvent& evt)
|
||||||
|
{
|
||||||
|
if (m_slider)
|
||||||
|
m_slider->OnKeyDown(evt);
|
||||||
|
}
|
||||||
|
|
||||||
void Preview::bind_event_handlers()
|
void Preview::bind_event_handlers()
|
||||||
{
|
{
|
||||||
this->Bind(wxEVT_SIZE, &Preview::on_size, this);
|
this->Bind(wxEVT_SIZE, &Preview::on_size, this);
|
||||||
|
|
|
@ -122,6 +122,7 @@ public:
|
||||||
void refresh_print();
|
void refresh_print();
|
||||||
|
|
||||||
void msw_rescale();
|
void msw_rescale();
|
||||||
|
void move_double_slider(wxKeyEvent& evt);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool init(wxWindow* parent, Bed3D& bed, Camera& camera, GLToolbar& view_toolbar, Model* model);
|
bool init(wxWindow* parent, Bed3D& bed, Camera& camera, GLToolbar& view_toolbar, Model* model);
|
||||||
|
|
|
@ -1517,6 +1517,7 @@ Plater::priv::priv(Plater *q, MainFrame *main_frame)
|
||||||
preview->get_wxglcanvas()->Bind(EVT_GLCANVAS_QUESTION_MARK, [this](SimpleEvent&) { wxGetApp().keyboard_shortcuts(); });
|
preview->get_wxglcanvas()->Bind(EVT_GLCANVAS_QUESTION_MARK, [this](SimpleEvent&) { wxGetApp().keyboard_shortcuts(); });
|
||||||
preview->get_wxglcanvas()->Bind(EVT_GLCANVAS_UPDATE_BED_SHAPE, [this](SimpleEvent&) { set_bed_shape(config->option<ConfigOptionPoints>("bed_shape")->values); });
|
preview->get_wxglcanvas()->Bind(EVT_GLCANVAS_UPDATE_BED_SHAPE, [this](SimpleEvent&) { set_bed_shape(config->option<ConfigOptionPoints>("bed_shape")->values); });
|
||||||
preview->get_wxglcanvas()->Bind(EVT_GLCANVAS_TAB, [this](SimpleEvent&) { select_next_view_3D(); });
|
preview->get_wxglcanvas()->Bind(EVT_GLCANVAS_TAB, [this](SimpleEvent&) { select_next_view_3D(); });
|
||||||
|
preview->get_wxglcanvas()->Bind(EVT_GLCANVAS_MOVE_DOUBLE_SLIDER, [this](wxKeyEvent& evt) { preview->move_double_slider(evt); });
|
||||||
|
|
||||||
q->Bind(EVT_SLICING_COMPLETED, &priv::on_slicing_completed, this);
|
q->Bind(EVT_SLICING_COMPLETED, &priv::on_slicing_completed, this);
|
||||||
q->Bind(EVT_PROCESS_COMPLETED, &priv::on_process_completed, this);
|
q->Bind(EVT_PROCESS_COMPLETED, &priv::on_process_completed, this);
|
||||||
|
@ -1670,6 +1671,22 @@ std::vector<size_t> Plater::priv::load_files(const std::vector<fs::path>& input_
|
||||||
if (load_config && !config_loaded.empty()) {
|
if (load_config && !config_loaded.empty()) {
|
||||||
// Based on the printer technology field found in the loaded config, select the base for the config,
|
// Based on the printer technology field found in the loaded config, select the base for the config,
|
||||||
PrinterTechnology printer_technology = Preset::printer_technology(config_loaded);
|
PrinterTechnology printer_technology = Preset::printer_technology(config_loaded);
|
||||||
|
|
||||||
|
// We can't to load SLA project if there is at least one multi-part object on the bed
|
||||||
|
if (printer_technology == ptSLA)
|
||||||
|
{
|
||||||
|
const ModelObjectPtrs& objects = q->model().objects;
|
||||||
|
for (auto object : objects)
|
||||||
|
if (object->volumes.size() > 1)
|
||||||
|
{
|
||||||
|
Slic3r::GUI::show_info(nullptr,
|
||||||
|
_(L("You can't to load SLA project if there is at least one multi-part object on the bed")) + "\n\n" +
|
||||||
|
_(L("Please check your object list before preset changing.")),
|
||||||
|
_(L("Attention!")));
|
||||||
|
return obj_idxs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
config.apply(printer_technology == ptFFF ?
|
config.apply(printer_technology == ptFFF ?
|
||||||
static_cast<const ConfigBase&>(FullPrintConfig::defaults()) :
|
static_cast<const ConfigBase&>(FullPrintConfig::defaults()) :
|
||||||
static_cast<const ConfigBase&>(SLAFullPrintConfig::defaults()));
|
static_cast<const ConfigBase&>(SLAFullPrintConfig::defaults()));
|
||||||
|
|
|
@ -586,7 +586,7 @@ wxDataViewItem ObjectDataViewModel::AddVolumeChild( const wxDataViewItem &parent
|
||||||
ItemAdded(parent_item, child);
|
ItemAdded(parent_item, child);
|
||||||
|
|
||||||
root->m_volumes_cnt++;
|
root->m_volumes_cnt++;
|
||||||
if (insert_position > 0) insert_position++;
|
if (insert_position >= 0) insert_position++;
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto node = new ObjectDataViewModelNode(root, name, GetVolumeIcon(volume_type, has_errors), extruder_str, root->m_volumes_cnt);
|
const auto node = new ObjectDataViewModelNode(root, name, GetVolumeIcon(volume_type, has_errors), extruder_str, root->m_volumes_cnt);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue