From 5b32d61a690cc95b7ddb3176e000e63b1cb3fdbc Mon Sep 17 00:00:00 2001 From: Enrico Turri Date: Tue, 26 Jun 2018 12:50:04 +0200 Subject: [PATCH 1/2] Fixed crash when slicing from Layers tab --- lib/Slic3r/GUI/Plater/2D.pm | 1 - lib/Slic3r/GUI/Plater/3DPreview.pm | 1 + xs/src/slic3r/GUI/GLCanvas3D.cpp | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Slic3r/GUI/Plater/2D.pm b/lib/Slic3r/GUI/Plater/2D.pm index 83c2a5021f7..88a05c2921e 100644 --- a/lib/Slic3r/GUI/Plater/2D.pm +++ b/lib/Slic3r/GUI/Plater/2D.pm @@ -233,7 +233,6 @@ sub mouse_event { } elsif ($event->LeftUp) { if ($self->{drag_object}) { $self->{on_instances_moved}->(); - Slic3r::GUI::_3DScene::reset_current_canvas(); } $self->{drag_start_pos} = undef; $self->{drag_object} = undef; diff --git a/lib/Slic3r/GUI/Plater/3DPreview.pm b/lib/Slic3r/GUI/Plater/3DPreview.pm index 9ed2374ec47..c7dab869fb7 100644 --- a/lib/Slic3r/GUI/Plater/3DPreview.pm +++ b/lib/Slic3r/GUI/Plater/3DPreview.pm @@ -279,6 +279,7 @@ sub reload_print { my ($self, $force) = @_; Slic3r::GUI::_3DScene::reset_volumes($self->canvas); + Slic3r::GUI::_3DScene::reset_current_canvas(); $self->_loaded(0); if (! $self->IsShown && ! $force) { diff --git a/xs/src/slic3r/GUI/GLCanvas3D.cpp b/xs/src/slic3r/GUI/GLCanvas3D.cpp index f5db9773193..2148579e815 100644 --- a/xs/src/slic3r/GUI/GLCanvas3D.cpp +++ b/xs/src/slic3r/GUI/GLCanvas3D.cpp @@ -2376,7 +2376,7 @@ void GLCanvas3D::load_gcode_preview(const GCodePreviewData& preview_data, const if ((m_canvas != nullptr) && (m_print != nullptr)) { // ensures that this canvas is current - if (!_3DScene::set_current(m_canvas, false)) + if (!_3DScene::set_current(m_canvas, true)) return; if (m_volumes.empty()) From f4ee973ab78e17625bcfab2e17a70c8f8f0e8171 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Tue, 26 Jun 2018 15:29:23 +0200 Subject: [PATCH 2/2] When running on Windows, Perl $^X returns slic3r.exe or slic3r-console.exe Do some magic to get the perl interpreter path. --- lib/Slic3r/Print.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index 8300fdbede6..a9763a82403 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -101,7 +101,12 @@ sub export_gcode { die "The configured post-processing script is not executable: check permissions. ($script)\n"; } if ($^O eq 'MSWin32' && $script =~ /\.[pP][lL]/) { - system($^X, $script, $output_file); + # The current process (^X) may be slic3r.exe or slic3r-console.exe. + # Replace it with the current perl interpreter. + my($filename, $directories, $suffix) = fileparse($^X); + $filename =~ s/^slic3r.*$/perl5\.24\.0\.exe/; + my $interpreter = $directories . $filename; + system($interpreter, $script, $output_file); } else { system($script, $output_file); }