Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer into et_custom_bed
This commit is contained in:
commit
9bcdb2ebd0
3 changed files with 206 additions and 225 deletions
|
@ -1138,7 +1138,6 @@ GLCanvas3D::GLCanvas3D(wxGLCanvas* canvas, Bed3D& bed, Camera& camera, GLToolbar
|
||||||
, m_moving_enabled(false)
|
, m_moving_enabled(false)
|
||||||
, m_dynamic_background_enabled(false)
|
, m_dynamic_background_enabled(false)
|
||||||
, m_multisample_allowed(false)
|
, m_multisample_allowed(false)
|
||||||
, m_regenerate_volumes(true)
|
|
||||||
, m_moving(false)
|
, m_moving(false)
|
||||||
, m_tab_down(false)
|
, m_tab_down(false)
|
||||||
, m_cursor_type(Standard)
|
, m_cursor_type(Standard)
|
||||||
|
@ -1777,12 +1776,6 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re
|
||||||
PrinterTechnology printer_technology = m_process->current_printer_technology();
|
PrinterTechnology printer_technology = m_process->current_printer_technology();
|
||||||
int volume_idx_wipe_tower_old = -1;
|
int volume_idx_wipe_tower_old = -1;
|
||||||
|
|
||||||
if (printer_technology == ptSLA)
|
|
||||||
// Always do the full refresh in SLA mode to show / hide SLA support structures when an object is moved outside / inside the build volume.
|
|
||||||
m_regenerate_volumes = true;
|
|
||||||
|
|
||||||
if (m_regenerate_volumes)
|
|
||||||
{
|
|
||||||
// Release invalidated volumes to conserve GPU memory in case of delayed refresh (see m_reload_delayed).
|
// Release invalidated volumes to conserve GPU memory in case of delayed refresh (see m_reload_delayed).
|
||||||
// First initialize model_volumes_new_sorted & model_instances_new_sorted.
|
// First initialize model_volumes_new_sorted & model_instances_new_sorted.
|
||||||
for (int object_idx = 0; object_idx < (int)m_model->objects.size(); ++ object_idx) {
|
for (int object_idx = 0; object_idx < (int)m_model->objects.size(); ++ object_idx) {
|
||||||
|
@ -1873,15 +1866,12 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sort_remove_duplicates(instance_ids_selected);
|
sort_remove_duplicates(instance_ids_selected);
|
||||||
}
|
|
||||||
|
|
||||||
if (m_reload_delayed)
|
if (m_reload_delayed)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool update_object_list = false;
|
bool update_object_list = false;
|
||||||
|
|
||||||
if (m_regenerate_volumes)
|
|
||||||
{
|
|
||||||
if (m_volumes.volumes != glvolumes_new)
|
if (m_volumes.volumes != glvolumes_new)
|
||||||
update_object_list = true;
|
update_object_list = true;
|
||||||
m_volumes.volumes = std::move(glvolumes_new);
|
m_volumes.volumes = std::move(glvolumes_new);
|
||||||
|
@ -2015,7 +2005,6 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re
|
||||||
m_selection.instances_changed(instance_ids_selected);
|
m_selection.instances_changed(instance_ids_selected);
|
||||||
else
|
else
|
||||||
m_selection.volumes_changed(map_glvolume_old_to_new);
|
m_selection.volumes_changed(map_glvolume_old_to_new);
|
||||||
}
|
|
||||||
|
|
||||||
m_gizmos.update_data();
|
m_gizmos.update_data();
|
||||||
m_gizmos.refresh_on_off_state();
|
m_gizmos.refresh_on_off_state();
|
||||||
|
@ -2058,9 +2047,6 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re
|
||||||
post_event(Event<bool>(EVT_GLCANVAS_ENABLE_ACTION_BUTTONS, false));
|
post_event(Event<bool>(EVT_GLCANVAS_ENABLE_ACTION_BUTTONS, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
// restore to default value
|
|
||||||
m_regenerate_volumes = true;
|
|
||||||
|
|
||||||
m_camera.set_scene_box(scene_bounding_box());
|
m_camera.set_scene_box(scene_bounding_box());
|
||||||
|
|
||||||
if (m_selection.is_empty())
|
if (m_selection.is_empty())
|
||||||
|
@ -2832,7 +2818,6 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_regenerate_volumes = false;
|
|
||||||
m_selection.translate(cur_pos - m_mouse.drag.start_position_3D);
|
m_selection.translate(cur_pos - m_mouse.drag.start_position_3D);
|
||||||
wxGetApp().obj_manipul()->set_dirty();
|
wxGetApp().obj_manipul()->set_dirty();
|
||||||
m_dirty = true;
|
m_dirty = true;
|
||||||
|
@ -2892,7 +2877,6 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
|
||||||
}
|
}
|
||||||
else if ((m_mouse.drag.move_volume_idx != -1) && m_mouse.dragging)
|
else if ((m_mouse.drag.move_volume_idx != -1) && m_mouse.dragging)
|
||||||
{
|
{
|
||||||
m_regenerate_volumes = false;
|
|
||||||
do_move(L("Move Object"));
|
do_move(L("Move Object"));
|
||||||
wxGetApp().obj_manipul()->set_dirty();
|
wxGetApp().obj_manipul()->set_dirty();
|
||||||
// Let the plater know that the dragging finished, so a delayed refresh
|
// Let the plater know that the dragging finished, so a delayed refresh
|
||||||
|
|
|
@ -437,7 +437,6 @@ private:
|
||||||
bool m_moving_enabled;
|
bool m_moving_enabled;
|
||||||
bool m_dynamic_background_enabled;
|
bool m_dynamic_background_enabled;
|
||||||
bool m_multisample_allowed;
|
bool m_multisample_allowed;
|
||||||
bool m_regenerate_volumes;
|
|
||||||
bool m_moving;
|
bool m_moving;
|
||||||
bool m_tab_down;
|
bool m_tab_down;
|
||||||
ECursorType m_cursor_type;
|
ECursorType m_cursor_type;
|
||||||
|
@ -626,7 +625,6 @@ public:
|
||||||
Linef3 mouse_ray(const Point& mouse_pos);
|
Linef3 mouse_ray(const Point& mouse_pos);
|
||||||
|
|
||||||
void set_mouse_as_dragging() { m_mouse.dragging = true; }
|
void set_mouse_as_dragging() { m_mouse.dragging = true; }
|
||||||
void disable_regenerate_volumes() { m_regenerate_volumes = false; }
|
|
||||||
void refresh_camera_scene_box() { m_camera.set_scene_box(scene_bounding_box()); }
|
void refresh_camera_scene_box() { m_camera.set_scene_box(scene_bounding_box()); }
|
||||||
bool is_mouse_dragging() const { return m_mouse.dragging; }
|
bool is_mouse_dragging() const { return m_mouse.dragging; }
|
||||||
|
|
||||||
|
|
|
@ -623,7 +623,6 @@ bool GLGizmosManager::on_mouse(wxMouseEvent& evt)
|
||||||
{
|
{
|
||||||
case Move:
|
case Move:
|
||||||
{
|
{
|
||||||
m_parent.disable_regenerate_volumes();
|
|
||||||
m_parent.do_move(L("Gizmo-Move"));
|
m_parent.do_move(L("Gizmo-Move"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue