mirror of
https://git.mirrors.martin98.com/https://github.com/slic3r/Slic3r.git
synced 2025-08-16 06:25:56 +08:00
#1076 adjust color changes for z_offset
This commit is contained in:
parent
d9ad9371aa
commit
0a65e1b0d6
@ -1457,7 +1457,7 @@ void GCode::_do_export(Print& print, FILE* file, ThumbnailsGeneratorCallback thu
|
|||||||
for (LayerToPrint <p : layers_to_print) {
|
for (LayerToPrint <p : layers_to_print) {
|
||||||
std::vector<LayerToPrint> lrs;
|
std::vector<LayerToPrint> lrs;
|
||||||
lrs.emplace_back(std::move(ltp));
|
lrs.emplace_back(std::move(ltp));
|
||||||
this->process_layer(file, print, print.m_print_statistics, lrs, tool_ordering.tools_for_layer(ltp.print_z()), nullptr, *print_object_instance_sequential_active - object.instances().data());
|
this->process_layer(file, print, print.m_print_statistics, lrs, tool_ordering.tools_for_layer(ltp.print_z() + print.config().z_offset), nullptr, *print_object_instance_sequential_active - object.instances().data());
|
||||||
print.throw_if_canceled();
|
print.throw_if_canceled();
|
||||||
}
|
}
|
||||||
#ifdef HAS_PRESSURE_EQUALIZER
|
#ifdef HAS_PRESSURE_EQUALIZER
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include "OpenGLManager.hpp"
|
#include "OpenGLManager.hpp"
|
||||||
#include "GLCanvas3D.hpp"
|
#include "GLCanvas3D.hpp"
|
||||||
#include "libslic3r/PresetBundle.hpp"
|
#include "libslic3r/PresetBundle.hpp"
|
||||||
|
#include "libslic3r/PrintConfig.hpp"
|
||||||
#include "DoubleSlider.hpp"
|
#include "DoubleSlider.hpp"
|
||||||
|
|
||||||
#include "BitmapCache.hpp"
|
#include "BitmapCache.hpp"
|
||||||
@ -653,7 +654,15 @@ wxBoxSizer* Preview::create_layers_slider_sizer()
|
|||||||
|
|
||||||
Bind(DoubleSlider::wxCUSTOMEVT_TICKSCHANGED, [this](wxEvent&) {
|
Bind(DoubleSlider::wxCUSTOMEVT_TICKSCHANGED, [this](wxEvent&) {
|
||||||
Model& model = wxGetApp().plater()->model();
|
Model& model = wxGetApp().plater()->model();
|
||||||
model.custom_gcode_per_print_z = m_layers_slider->GetTicksValues();
|
Info custom_gcode_per_print_z = m_layers_slider->GetTicksValues();
|
||||||
|
//remove z-shift from gcode output
|
||||||
|
const float z_shift = wxGetApp().preset_bundle->printers.get_edited_preset().config.opt_float("z_offset");
|
||||||
|
if (can_display_gcode() && z_shift != 0) {
|
||||||
|
for (CustomGCode::Item& tick : custom_gcode_per_print_z.gcodes) {
|
||||||
|
tick.print_z -= z_shift;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
model.custom_gcode_per_print_z = custom_gcode_per_print_z;
|
||||||
m_schedule_background_process();
|
m_schedule_background_process();
|
||||||
|
|
||||||
#if ENABLE_PREVIEW_TYPE_CHANGE
|
#if ENABLE_PREVIEW_TYPE_CHANGE
|
||||||
@ -731,7 +740,15 @@ void Preview::update_layers_slider(const std::vector<double>& layers_z, bool kee
|
|||||||
update_layers_slider_mode();
|
update_layers_slider_mode();
|
||||||
|
|
||||||
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
|
||||||
|
const float z_shift = wxGetApp().preset_bundle->printers.get_edited_preset().config.opt_float("z_offset");
|
||||||
|
if (can_display_gcode() && z_shift != 0) {
|
||||||
|
for (CustomGCode::Item& tick : ticks_info_from_model.gcodes) {
|
||||||
|
tick.print_z += z_shift;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//check incoherencies
|
||||||
check_layers_slider_values(ticks_info_from_model.gcodes, layers_z);
|
check_layers_slider_values(ticks_info_from_model.gcodes, layers_z);
|
||||||
|
|
||||||
m_layers_slider->SetSliderValues(layers_z);
|
m_layers_slider->SetSliderValues(layers_z);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user