diff --git a/lib/Slic3r/Print/GCode.pm b/lib/Slic3r/Print/GCode.pm index 63ee24282..2dfe1db5d 100644 --- a/lib/Slic3r/Print/GCode.pm +++ b/lib/Slic3r/Print/GCode.pm @@ -219,7 +219,7 @@ sub export { if ($self->config->complete_objects) { # print objects from the smallest to the tallest to avoid collisions # when moving onto next object starting point - my @obj_idx = sort { $self->objects->[$a]->size->z <=> $self->objects->[$b]->size->z } 0..($self->print->object_count - 1); + my @obj_idx = sort { $self->objects->[$a]->config->sequential_print_priority <=> $self->objects->[$b]->config->sequential_print_priority or $self->objects->[$a]->size->z <=> $self->objects->[$b]->size->z} 0..($self->print->object_count - 1); my $finished_objects = 0; for my $obj_idx (@obj_idx) { diff --git a/lib/Slic3r/Print/Simple.pm b/lib/Slic3r/Print/Simple.pm index 26f1d4383..4febfa6ab 100644 --- a/lib/Slic3r/Print/Simple.pm +++ b/lib/Slic3r/Print/Simple.pm @@ -91,7 +91,8 @@ sub set_model { # if all input objects have defined position(s) apply duplication to the whole model $model->duplicate($self->duplicate, $self->_print->config->min_object_distance, $bb); } - $_->translate(0,0,-$_->bounding_box->z_min) for @{$model->objects}; + $_->translate(0,0,-$_->bounding_box->z_min) for @{$model->objects} ; + if (!$self->dont_arrange) { my $print_center = $self->print_center diff --git a/xs/src/libslic3r/PrintConfig.cpp b/xs/src/libslic3r/PrintConfig.cpp index 431a5ea66..0056a8a20 100644 --- a/xs/src/libslic3r/PrintConfig.cpp +++ b/xs/src/libslic3r/PrintConfig.cpp @@ -1662,6 +1662,13 @@ PrintConfigDef::PrintConfigDef() def->tooltip = "Set this to the number of *full* steps (not microsteps) needed for moving the Z axis by 1mm; you can calculate this by dividing the number of microsteps configured in your firmware by the microstepping amount (8, 16, 32). Slic3r will round your configured layer height to the nearest multiple of that value in order to ensure the best accuracy. This is most useful for machines with imperial leadscrews or belt-driven Z or for unusual layer heights with metric leadscrews. Set to zero to disable this experimental feature."; def->cli = "z-steps-per-mm=f"; def->default_value = new ConfigOptionFloat(0); + + def = this->add("sequential_print_priority", coInt); + def->label = "Sequential Printing Priority"; + def->category = "Advanced"; + def->tooltip ="Set this to alter object priority for sequential printing. Objects are first sorted by priority (smaller integers print first), then by height."; + def->cli = "sequential-print-priority=i"; + def->default_value = new ConfigOptionInt(0); } const PrintConfigDef print_config_def; diff --git a/xs/src/libslic3r/PrintConfig.hpp b/xs/src/libslic3r/PrintConfig.hpp index 74b850326..292b3eab5 100644 --- a/xs/src/libslic3r/PrintConfig.hpp +++ b/xs/src/libslic3r/PrintConfig.hpp @@ -182,6 +182,7 @@ class PrintObjectConfig : public virtual StaticPrintConfig ConfigOptionFloat support_material_speed; ConfigOptionFloatOrPercent support_material_threshold; ConfigOptionFloat xy_size_compensation; + ConfigOptionInt sequential_print_priority; PrintObjectConfig(bool initialize = true) : StaticPrintConfig() { if (initialize) @@ -217,6 +218,7 @@ class PrintObjectConfig : public virtual StaticPrintConfig OPT_PTR(support_material_speed); OPT_PTR(support_material_threshold); OPT_PTR(xy_size_compensation); + OPT_PTR(sequential_print_priority); return NULL; };