From b5276e6e25a0bbb8da540f33bcbf1f34793b7f99 Mon Sep 17 00:00:00 2001 From: Giles Bathgate Date: Fri, 8 Dec 2017 00:35:01 +0000 Subject: [PATCH] Auto align z preference (#4218) * Add preference to disable auto alignment to the z plane * Make it clear auto-center preference only effects x,y --- lib/Slic3r/GUI.pm | 1 + lib/Slic3r/GUI/Plater.pm | 10 +++++++--- lib/Slic3r/GUI/Preferences.pm | 9 ++++++++- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lib/Slic3r/GUI.pm b/lib/Slic3r/GUI.pm index d473eef07..9f9aec454 100644 --- a/lib/Slic3r/GUI.pm +++ b/lib/Slic3r/GUI.pm @@ -84,6 +84,7 @@ our $Settings = { _ => { version_check => 1, autocenter => 1, + autoalignz => 1, invert_zoom => 0, background_processing => 0, threads => $Slic3r::Config::Options->{threads}{default}, diff --git a/lib/Slic3r/GUI/Plater.pm b/lib/Slic3r/GUI/Plater.pm index 451280629..d88fce573 100644 --- a/lib/Slic3r/GUI/Plater.pm +++ b/lib/Slic3r/GUI/Plater.pm @@ -1265,12 +1265,16 @@ sub load_model_objects { # if user turned autocentering off, automatic arranging would disappoint them $need_arrange = 0; - $o->align_to_ground; # aligns object to Z = 0 + if ($Slic3r::GUI::Settings->{_}{autoalignz}) { + $o->align_to_ground; # aligns object to Z = 0 + } $o->add_instance(); } } else { - # if object has defined positions we still need to ensure it's aligned to Z = 0 - $o->align_to_ground; + if ($Slic3r::GUI::Settings->{_}{autoalignz}) { + # if object has defined positions we still need to ensure it's aligned to Z = 0 + $o->align_to_ground; + } } { diff --git a/lib/Slic3r/GUI/Preferences.pm b/lib/Slic3r/GUI/Preferences.pm index c995258bb..e6ce149f9 100644 --- a/lib/Slic3r/GUI/Preferences.pm +++ b/lib/Slic3r/GUI/Preferences.pm @@ -38,10 +38,17 @@ sub new { $optgroup->append_single_option_line(Slic3r::GUI::OptionsGroup::Option->new( opt_id => 'autocenter', type => 'bool', - label => 'Auto-center parts', + label => 'Auto-center parts (x,y)', tooltip => 'If this is enabled, Slic3r will auto-center objects around the print bed center.', default => $Slic3r::GUI::Settings->{_}{autocenter}, )); + $optgroup->append_single_option_line(Slic3r::GUI::OptionsGroup::Option->new( + opt_id => 'autoalignz', + type => 'bool', + label => 'Auto-align parts (z=0)', + tooltip => 'If this is enabled, Slic3r will auto-align objects z value to be on the print bed at z=0.', + default => $Slic3r::GUI::Settings->{_}{autoalignz}, + )); $optgroup->append_single_option_line(Slic3r::GUI::OptionsGroup::Option->new( opt_id => 'invert_zoom', type => 'bool',