QoL: show transparent shell in gcode preview and truncate long gcode line caused by native Klipper commands

This commit is contained in:
SoftFever 2023-08-29 21:25:47 +08:00
parent 40b08bb0e1
commit 95d12c24f6
23 changed files with 157 additions and 133 deletions

View file

@ -1,3 +1,4 @@
#include "slic3r/GUI/3DScene.hpp"
#include <GL/glew.h>
#if ENABLE_SMOOTH_NORMALS
@ -1615,6 +1616,16 @@ void GLVolumeCollection::update_colors_by_extruder(const DynamicPrintConfig *con
}
}
void GLVolumeCollection::set_transparency(float alpha)
{
for (GLVolume *volume : volumes) {
if (volume == nullptr || volume->is_modifier || volume->is_wipe_tower || (volume->volume_idx() < 0))
continue;
volume->color[3] = alpha;
}
}
std::vector<double> GLVolumeCollection::get_current_print_zs(bool active_only) const
{
// Collect layer top positions of all volumes.