Fix requesting z_offset from sla printer

This commit is contained in:
Pavulon87 2021-04-25 08:16:30 +02:00 committed by remi durand
parent 98702a0060
commit 7106a76287

View File

@ -741,11 +741,14 @@ void Preview::update_layers_slider(const std::vector<double>& layers_z, bool kee
Plater* plater = wxGetApp().plater(); Plater* plater = wxGetApp().plater();
CustomGCode::Info ticks_info_from_model = plater->model().custom_gcode_per_print_z; CustomGCode::Info ticks_info_from_model = plater->model().custom_gcode_per_print_z;
//add z-shift from gcode output if (wxGetApp().preset_bundle && wxGetApp().preset_bundle->printers.get_edited_preset().config.option("z_offset"))
const float z_shift = wxGetApp().preset_bundle->printers.get_edited_preset().config.opt_float("z_offset"); {
if (can_display_gcode() && z_shift != 0) { //add z-shift from gcode output
for (CustomGCode::Item& tick : ticks_info_from_model.gcodes) { const float z_shift = wxGetApp().preset_bundle->printers.get_edited_preset().config.opt_float("z_offset");
tick.print_z += z_shift; if (can_display_gcode() && z_shift != 0) {
for (CustomGCode::Item& tick : ticks_info_from_model.gcodes) {
tick.print_z += z_shift;
}
} }
} }
//check incoherencies //check incoherencies