diff --git a/cmake/msvc/xs.wperl64d.props b/cmake/msvc/xs.wperl.props.in
similarity index 61%
rename from cmake/msvc/xs.wperl64d.props
rename to cmake/msvc/xs.wperl.props.in
index b604a56e23..5c7461dc71 100644
--- a/cmake/msvc/xs.wperl64d.props
+++ b/cmake/msvc/xs.wperl.props.in
@@ -1,18 +1,22 @@
+
- $(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(FxCopDir);$(PATH);c:\wperl64d\bin\;
+ $(VC_ExecutablePath_x64);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(FxCopDir);$(PATH);${PROPS_PERL_BIN_PATH}\;
- C:\wperl64d\bin\perl.exe
+ ${PROPS_PERL_EXECUTABLE}
slic3r.pl
WindowsLocalDebugger
- ..\..
+ ${PROPS_CMAKE_SOURCE_DIR}
diff --git a/lib/Slic3r/GUI/3DScene.pm b/lib/Slic3r/GUI/3DScene.pm
index 352a612643..59b5367b58 100644
--- a/lib/Slic3r/GUI/3DScene.pm
+++ b/lib/Slic3r/GUI/3DScene.pm
@@ -1152,7 +1152,11 @@ sub InitGL {
$self->volumes->finalize_geometry(1)
if ($^O eq 'linux' && $self->UseVBOs);
- $self->zoom_to_bed;
+ if (scalar @{$self->volumes} > 0) {
+ $self->zoom_to_volumes;
+ } else {
+ $self->zoom_to_bed;
+ }
glClearColor(0, 0, 0, 1);
glColor3f(1, 0, 0);
diff --git a/lib/Slic3r/GUI/Plater.pm b/lib/Slic3r/GUI/Plater.pm
index ac1a1f0be2..a0fbf15470 100644
--- a/lib/Slic3r/GUI/Plater.pm
+++ b/lib/Slic3r/GUI/Plater.pm
@@ -1809,8 +1809,7 @@ sub list_item_deselected {
if ($self->{list}->GetFirstSelected == -1) {
$self->select_object(undef);
$self->{canvas}->Refresh;
- #FIXME VBOs are being refreshed just to change a selection color?
- $self->{canvas3D}->reload_scene if $self->{canvas3D};
+ $self->{canvas3D}->deselect_volumes if $self->{canvas3D};
}
undef $self->{_lecursor};
}
@@ -1822,8 +1821,7 @@ sub list_item_selected {
my $obj_idx = $event->GetIndex;
$self->select_object($obj_idx);
$self->{canvas}->Refresh;
- #FIXME VBOs are being refreshed just to change a selection color?
- $self->{canvas3D}->reload_scene if $self->{canvas3D};
+ $self->{canvas3D}->update_volumes_selection if $self->{canvas3D};
undef $self->{_lecursor};
}
@@ -2015,8 +2013,15 @@ sub selection_changed {
sub select_object {
my ($self, $obj_idx) = @_;
+
+ # remove current selection
+ foreach my $o (0..$#{$self->{objects}}) {
+ $PreventListEvents = 1;
+ $self->{objects}->[$o]->selected(0);
+ $self->{list}->Select($o, 0);
+ $PreventListEvents = 0;
+ }
- $_->selected(0) for @{ $self->{objects} };
if (defined $obj_idx) {
$self->{objects}->[$obj_idx]->selected(1);
# We use this flag to avoid circular event handling
diff --git a/lib/Slic3r/GUI/Plater/3D.pm b/lib/Slic3r/GUI/Plater/3D.pm
index dce60e2c44..ced6fb82ea 100644
--- a/lib/Slic3r/GUI/Plater/3D.pm
+++ b/lib/Slic3r/GUI/Plater/3D.pm
@@ -31,7 +31,9 @@ sub new {
$self->{on_select_object} = sub {};
$self->{on_instances_moved} = sub {};
$self->{on_wipe_tower_moved} = sub {};
-
+
+ $self->{objects_volumes_idxs} = ();
+
$self->on_select(sub {
my ($volume_idx) = @_;
$self->{on_select_object}->(($volume_idx == -1) ? undef : $self->volumes->[$volume_idx]->object_idx)
@@ -181,6 +183,17 @@ sub set_on_enable_action_buttons {
$self->on_enable_action_buttons($cb);
}
+sub update_volumes_selection {
+ my ($self) = @_;
+
+ foreach my $obj_idx (0..$#{$self->{model}->objects}) {
+ if ($self->{objects}[$obj_idx]->selected) {
+ my @volume_idxs = @{$self->{objects_volumes_idxs}[$obj_idx]};
+ $self->select_volume($_) for @volume_idxs;
+ }
+ }
+}
+
sub reload_scene {
my ($self, $force) = @_;
@@ -194,12 +207,14 @@ sub reload_scene {
$self->{reload_delayed} = 0;
+ $self->{objects_volumes_idxs} = ();
foreach my $obj_idx (0..$#{$self->{model}->objects}) {
my @volume_idxs = $self->load_object($self->{model}, $self->{print}, $obj_idx);
- if ($self->{objects}[$obj_idx]->selected) {
- $self->select_volume($_) for @volume_idxs;
- }
+ push(@{$self->{objects_volumes_idxs}}, \@volume_idxs);
}
+
+ $self->update_volumes_selection;
+
if (defined $self->{config}->nozzle_diameter) {
# Should the wipe tower be visualized?
my $extruders_count = scalar @{ $self->{config}->nozzle_diameter };
diff --git a/lib/Slic3r/GUI/Plater/ObjectCutDialog.pm b/lib/Slic3r/GUI/Plater/ObjectCutDialog.pm
index 0cc8b2decc..4d55e313a6 100644
--- a/lib/Slic3r/GUI/Plater/ObjectCutDialog.pm
+++ b/lib/Slic3r/GUI/Plater/ObjectCutDialog.pm
@@ -116,7 +116,6 @@ sub new {
$canvas->set_auto_bed_shape;
$canvas->SetSize([500,500]);
$canvas->SetMinSize($canvas->GetSize);
- $canvas->zoom_to_volumes;
}
$self->{sizer} = Wx::BoxSizer->new(wxHORIZONTAL);
diff --git a/lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm b/lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm
index f7e38ed873..28e3bf92b5 100644
--- a/lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm
+++ b/lib/Slic3r/GUI/Plater/ObjectPartsPanel.pm
@@ -163,7 +163,6 @@ sub new {
$canvas->set_auto_bed_shape;
$canvas->SetSize([500,700]);
$canvas->update_volumes_colors_by_extruder($self->GetParent->GetParent->GetParent->{config});
- $canvas->zoom_to_volumes;
}
$self->{sizer} = Wx::BoxSizer->new(wxHORIZONTAL);
diff --git a/xs/CMakeLists.txt b/xs/CMakeLists.txt
index f67697b13e..4f97c0acfe 100644
--- a/xs/CMakeLists.txt
+++ b/xs/CMakeLists.txt
@@ -665,7 +665,12 @@ endif ()
if (MSVC)
# Here we associate some additional properties with the MSVC project to enable compilation and debugging out of the box.
- set_target_properties(XS PROPERTIES VS_USER_PROPS "${PROJECT_SOURCE_DIR}/cmake/msvc/xs.wperl64d.props")
+ get_filename_component(PROPS_PERL_BIN_PATH "${PERL_EXECUTABLE}" DIRECTORY)
+ string(REPLACE "/" "\\" PROPS_PERL_BIN_PATH "${PROPS_PERL_BIN_PATH}")
+ string(REPLACE "/" "\\" PROPS_PERL_EXECUTABLE "${PERL_EXECUTABLE}")
+ string(REPLACE "/" "\\" PROPS_CMAKE_SOURCE_DIR "${CMAKE_SOURCE_DIR}")
+ configure_file("${PROJECT_SOURCE_DIR}/cmake/msvc/xs.wperl.props.in" "${CMAKE_BINARY_DIR}/xs.wperl.props" NEWLINE_STYLE CRLF)
+ set_target_properties(XS PROPERTIES VS_USER_PROPS "${CMAKE_BINARY_DIR}/xs.wperl.props")
endif()
# l10n
diff --git a/xs/src/libslic3r/Model.cpp b/xs/src/libslic3r/Model.cpp
index aaea863e83..a43bf02213 100644
--- a/xs/src/libslic3r/Model.cpp
+++ b/xs/src/libslic3r/Model.cpp
@@ -269,6 +269,10 @@ TriangleMesh Model::mesh() const
static bool _arrange(const Pointfs &sizes, coordf_t dist, const BoundingBoxf* bb, Pointfs &out)
{
+ if (sizes.empty())
+ // return if the list is empty or the following call to BoundingBoxf constructor will lead to a crash
+ return true;
+
// we supply unscaled data to arrange()
bool result = Slic3r::Geometry::arrange(
sizes.size(), // number of parts
diff --git a/xs/src/libslic3r/Print.cpp b/xs/src/libslic3r/Print.cpp
index e692b1e9ee..80f68c51b6 100644
--- a/xs/src/libslic3r/Print.cpp
+++ b/xs/src/libslic3r/Print.cpp
@@ -598,10 +598,10 @@ std::string Print::validate() const
return "The Wipe Tower is currently only supported with the relative extruder addressing (use_relative_e_distances=1).";
SlicingParameters slicing_params0 = this->objects.front()->slicing_parameters();
- const PrintObject* most_layered_object = this->objects.front(); // object with highest layer_height_profile.size() encountered so far
+ const PrintObject* tallest_object = this->objects.front(); // let's find the tallest object
for (const auto* object : objects)
- if (object->layer_height_profile.size() > most_layered_object->layer_height_profile.size())
- most_layered_object = object;
+ if (*(object->layer_height_profile.end()-2) > *(tallest_object->layer_height_profile.end()-2) )
+ tallest_object = object;
for (PrintObject *object : this->objects) {
SlicingParameters slicing_params = object->slicing_parameters();
@@ -618,17 +618,26 @@ std::string Print::validate() const
object->update_layer_height_profile();
object->layer_height_profile_valid = was_layer_height_profile_valid;
- if ( this->config.variable_layer_height ) {
- int i = 0;
- while ( i < object->layer_height_profile.size() ) {
- if (std::abs(most_layered_object->layer_height_profile[i] - object->layer_height_profile[i]) > EPSILON)
- return "The Wipe tower is only supported if all objects have the same layer height profile";
- ++i;
- if (i == object->layer_height_profile.size()-2) // this element contains the objects max z, if the other object is taller,
- // it does not have to match - we will step over it
- if (most_layered_object->layer_height_profile[i] > object->layer_height_profile[i])
- ++i;
+ if ( this->config.variable_layer_height ) { // comparing layer height profiles
+ bool failed = false;
+ if (tallest_object->layer_height_profile.size() >= object->layer_height_profile.size() ) {
+ int i = 0;
+ while ( i < object->layer_height_profile.size() && i < tallest_object->layer_height_profile.size()) {
+ if (std::abs(tallest_object->layer_height_profile[i] - object->layer_height_profile[i])) {
+ failed = true;
+ break;
+ }
+ ++i;
+ if (i == object->layer_height_profile.size()-2) // this element contains this objects max z
+ if (tallest_object->layer_height_profile[i] > object->layer_height_profile[i]) // the difference does not matter in this case
+ ++i;
+ }
}
+ else
+ failed = true;
+
+ if (failed)
+ return "The Wipe tower is only supported if all objects have the same layer height profile";
}
/*for (size_t i = 5; i < object->layer_height_profile.size(); i += 2)
diff --git a/xs/src/slic3r/GUI/ConfigWizard.cpp b/xs/src/slic3r/GUI/ConfigWizard.cpp
index 84f401ba11..1217f86831 100644
--- a/xs/src/slic3r/GUI/ConfigWizard.cpp
+++ b/xs/src/slic3r/GUI/ConfigWizard.cpp
@@ -4,6 +4,8 @@
#include
#include
+#include
+
#include
#include
#include
@@ -741,9 +743,12 @@ void ConfigWizard::priv::apply_config(AppConfig *app_config, PresetBundle *prese
if (install_bundles.size() > 0) {
// Install bundles from resources.
updater->install_bundles_rsrc(std::move(install_bundles), snapshot);
+ } else {
+ BOOST_LOG_TRIVIAL(info) << "No bundles need to be installed from resources";
}
if (page_welcome->reset_user_profile()) {
+ BOOST_LOG_TRIVIAL(info) << "Resetting user profiles...";
preset_bundle->reset(true);
}
@@ -828,10 +833,13 @@ ConfigWizard::~ConfigWizard() {}
bool ConfigWizard::run(PresetBundle *preset_bundle, const PresetUpdater *updater)
{
+ BOOST_LOG_TRIVIAL(info) << "Running ConfigWizard, reason: " << p->run_reason;
if (ShowModal() == wxID_OK) {
p->apply_config(GUI::get_app_config(), preset_bundle, updater);
+ BOOST_LOG_TRIVIAL(info) << "ConfigWizard applied";
return true;
} else {
+ BOOST_LOG_TRIVIAL(info) << "ConfigWizard cancelled";
return false;
}
}
diff --git a/xs/src/slic3r/GUI/Tab.cpp b/xs/src/slic3r/GUI/Tab.cpp
index ee75f1920d..ed86fac51d 100644
--- a/xs/src/slic3r/GUI/Tab.cpp
+++ b/xs/src/slic3r/GUI/Tab.cpp
@@ -1312,7 +1312,7 @@ void TabFilament::build()
};
optgroup->append_line(line);
- optgroup = page->new_optgroup(_(L("Toolchange behaviour")));
+ optgroup = page->new_optgroup(_(L("Toolchange parameters with single extruder MM printers")));
optgroup->append_single_option_line("filament_loading_speed");
optgroup->append_single_option_line("filament_unloading_speed");
optgroup->append_single_option_line("filament_toolchange_delay");