mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-17 15:15:56 +08:00
Fix to autocenter option. (#4156)
* Fix to autocenter option. Ensure that with autocenter turned off the part is not positioned in the center of the bed. * Ensure object is aligned to Z=0 with autocentering off.
This commit is contained in:
parent
f302df3fb6
commit
4f2250dc70
@ -1253,12 +1253,20 @@ sub load_model_objects {
|
||||
push @obj_idx, $#{ $self->{objects} };
|
||||
|
||||
if ($model_object->instances_count == 0) {
|
||||
# if object has no defined position(s) we need to rearrange everything after loading
|
||||
$need_arrange = 1;
|
||||
|
||||
# add a default instance and center object around origin
|
||||
$o->center_around_origin; # also aligns object to Z = 0
|
||||
$o->add_instance(offset => $bed_centerf);
|
||||
if ($Slic3r::GUI::Settings->{_}{autocenter}) {
|
||||
# if object has no defined position(s) we need to rearrange everything after loading
|
||||
$need_arrange = 1;
|
||||
|
||||
# add a default instance and center object around origin
|
||||
$o->center_around_origin; # also aligns object to Z = 0
|
||||
$o->add_instance(offset => $bed_centerf);
|
||||
} else {
|
||||
# if user turned autocentering off, automatic arranging would disappoint them
|
||||
$need_arrange = 0;
|
||||
|
||||
$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;
|
||||
@ -1278,10 +1286,6 @@ sub load_model_objects {
|
||||
$self->{print}->add_model_object($o);
|
||||
}
|
||||
|
||||
# if user turned autocentering off, automatic arranging would disappoint them
|
||||
if (!$Slic3r::GUI::Settings->{_}{autocenter}) {
|
||||
$need_arrange = 0;
|
||||
}
|
||||
|
||||
if ($scaled_down) {
|
||||
Slic3r::GUI::show_info(
|
||||
|
Loading…
x
Reference in New Issue
Block a user