Merge branch 'master' of https://github.com/prusa3d/PrusaSlicer
This commit is contained in:
commit
58d57f9b71
@ -47,6 +47,7 @@ enum PrintStep {
|
|||||||
// psToolOrdering is a synonym to psWipeTower, as the Wipe Tower calculates and modifies the ToolOrdering,
|
// psToolOrdering is a synonym to psWipeTower, as the Wipe Tower calculates and modifies the ToolOrdering,
|
||||||
// while if printing without the Wipe Tower, the ToolOrdering is calculated as well.
|
// while if printing without the Wipe Tower, the ToolOrdering is calculated as well.
|
||||||
psToolOrdering = psWipeTower,
|
psToolOrdering = psWipeTower,
|
||||||
|
psSlicingFinished = psToolOrdering,
|
||||||
psGCodeExport,
|
psGCodeExport,
|
||||||
psCount,
|
psCount,
|
||||||
};
|
};
|
||||||
|
@ -122,7 +122,9 @@ void BackgroundSlicingProcess::process_fff()
|
|||||||
assert(m_print == m_fff_print);
|
assert(m_print == m_fff_print);
|
||||||
m_print->process();
|
m_print->process();
|
||||||
wxCommandEvent evt(m_event_slicing_completed_id);
|
wxCommandEvent evt(m_event_slicing_completed_id);
|
||||||
evt.SetInt((int)(m_fff_print->step_state_with_timestamp(PrintStep::psBrim).timestamp));
|
// Post the Slicing Finished message for the G-code viewer to update.
|
||||||
|
// Passing the timestamp
|
||||||
|
evt.SetInt((int)(m_fff_print->step_state_with_timestamp(PrintStep::psSlicingFinished).timestamp));
|
||||||
wxQueueEvent(GUI::wxGetApp().mainframe->m_plater, evt.Clone());
|
wxQueueEvent(GUI::wxGetApp().mainframe->m_plater, evt.Clone());
|
||||||
#if ENABLE_GCODE_VIEWER
|
#if ENABLE_GCODE_VIEWER
|
||||||
m_fff_print->export_gcode(m_temp_output_path, m_gcode_result, m_thumbnail_cb);
|
m_fff_print->export_gcode(m_temp_output_path, m_gcode_result, m_thumbnail_cb);
|
||||||
|
@ -4465,8 +4465,7 @@ static void debug_output_thumbnail(const ThumbnailData& thumbnail_data)
|
|||||||
|
|
||||||
void GLCanvas3D::_render_thumbnail_internal(ThumbnailData& thumbnail_data, bool printable_only, bool parts_only, bool show_bed, bool transparent_background) const
|
void GLCanvas3D::_render_thumbnail_internal(ThumbnailData& thumbnail_data, bool printable_only, bool parts_only, bool show_bed, bool transparent_background) const
|
||||||
{
|
{
|
||||||
auto is_visible = [](const GLVolume& v) -> bool
|
auto is_visible = [](const GLVolume& v) {
|
||||||
{
|
|
||||||
bool ret = v.printable;
|
bool ret = v.printable;
|
||||||
ret &= (!v.shader_outside_printer_detection_enabled || !v.is_outside);
|
ret &= (!v.shader_outside_printer_detection_enabled || !v.is_outside);
|
||||||
return ret;
|
return ret;
|
||||||
@ -4477,10 +4476,8 @@ void GLCanvas3D::_render_thumbnail_internal(ThumbnailData& thumbnail_data, bool
|
|||||||
|
|
||||||
GLVolumePtrs visible_volumes;
|
GLVolumePtrs visible_volumes;
|
||||||
|
|
||||||
for (GLVolume* vol : m_volumes.volumes)
|
for (GLVolume* vol : m_volumes.volumes) {
|
||||||
{
|
if (!vol->is_modifier && !vol->is_wipe_tower && (!parts_only || (vol->composite_id.volume_id >= 0))) {
|
||||||
if (!vol->is_modifier && !vol->is_wipe_tower && (!parts_only || (vol->composite_id.volume_id >= 0)))
|
|
||||||
{
|
|
||||||
if (!printable_only || is_visible(*vol))
|
if (!printable_only || is_visible(*vol))
|
||||||
visible_volumes.emplace_back(vol);
|
visible_volumes.emplace_back(vol);
|
||||||
}
|
}
|
||||||
@ -4490,8 +4487,7 @@ void GLCanvas3D::_render_thumbnail_internal(ThumbnailData& thumbnail_data, bool
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
BoundingBoxf3 box;
|
BoundingBoxf3 box;
|
||||||
for (const GLVolume* vol : visible_volumes)
|
for (const GLVolume* vol : visible_volumes) {
|
||||||
{
|
|
||||||
box.merge(vol->transformed_bounding_box());
|
box.merge(vol->transformed_bounding_box());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -4505,8 +4501,7 @@ void GLCanvas3D::_render_thumbnail_internal(ThumbnailData& thumbnail_data, bool
|
|||||||
double near_z = -1.0;
|
double near_z = -1.0;
|
||||||
double far_z = -1.0;
|
double far_z = -1.0;
|
||||||
|
|
||||||
if (show_bed)
|
if (show_bed) {
|
||||||
{
|
|
||||||
// extends the near and far z of the frustrum to avoid the bed being clipped
|
// extends the near and far z of the frustrum to avoid the bed being clipped
|
||||||
|
|
||||||
// box in eye space
|
// box in eye space
|
||||||
@ -4517,7 +4512,7 @@ void GLCanvas3D::_render_thumbnail_internal(ThumbnailData& thumbnail_data, bool
|
|||||||
|
|
||||||
camera.apply_projection(box, near_z, far_z);
|
camera.apply_projection(box, near_z, far_z);
|
||||||
|
|
||||||
GLShaderProgram* shader = wxGetApp().get_shader("gouraud");
|
GLShaderProgram* shader = wxGetApp().get_shader("gouraud_light");
|
||||||
if (shader == nullptr)
|
if (shader == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -4530,8 +4525,7 @@ void GLCanvas3D::_render_thumbnail_internal(ThumbnailData& thumbnail_data, bool
|
|||||||
shader->start_using();
|
shader->start_using();
|
||||||
shader->set_uniform("print_box.volume_detection", 0);
|
shader->set_uniform("print_box.volume_detection", 0);
|
||||||
|
|
||||||
for (const GLVolume* vol : visible_volumes)
|
for (const GLVolume* vol : visible_volumes) {
|
||||||
{
|
|
||||||
shader->set_uniform("uniform_color", (vol->printable && !vol->is_outside) ? orange : gray);
|
shader->set_uniform("uniform_color", (vol->printable && !vol->is_outside) ? orange : gray);
|
||||||
vol->render();
|
vol->render();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user