diff --git a/src/libslic3r/Technologies.hpp b/src/libslic3r/Technologies.hpp index 350f6aedc5..acbb4731d3 100644 --- a/src/libslic3r/Technologies.hpp +++ b/src/libslic3r/Technologies.hpp @@ -73,4 +73,13 @@ #define ENABLE_FIX_SUPERSLICER_GCODE_IMPORT (1 && ENABLE_2_4_0_ALPHA3) +//==================== +// 2.4.0.alpha4 techs +//==================== +#define ENABLE_2_4_0_ALPHA4 1 + +// Enable rendering modifiers and similar objects always as transparent +#define ENABLE_MODIFIERS_ALWAYS_TRANSPARENT (1 && ENABLE_2_4_0_ALPHA4) + + #endif // _prusaslicer_technologies_h_ diff --git a/src/slic3r/GUI/3DScene.cpp b/src/slic3r/GUI/3DScene.cpp index dfc10658dd..27eb693634 100644 --- a/src/slic3r/GUI/3DScene.cpp +++ b/src/slic3r/GUI/3DScene.cpp @@ -464,9 +464,15 @@ std::array color_from_model_volume(const ModelVolume& model_volume) color[2] = 0.2f; } else if (model_volume.is_modifier()) { +#if ENABLE_MODIFIERS_ALWAYS_TRANSPARENT + color[0] = 1.0f; + color[1] = 1.0f; + color[2] = 0.2f; +#else color[0] = 0.2f; color[1] = 1.0f; color[2] = 0.2f; +#endif // ENABLE_MODIFIERS_ALWAYS_TRANSPARENT } else if (model_volume.is_support_blocker()) { color[0] = 1.0f; @@ -836,7 +842,15 @@ void GLVolumeCollection::render(GLVolumeCollection::ERenderType type, bool disab glsafe(::glDisable(GL_CULL_FACE)); for (GLVolumeWithIdAndZ& volume : to_render) { +#if ENABLE_MODIFIERS_ALWAYS_TRANSPARENT + if (type == ERenderType::Transparent) + volume.first->force_transparent = true; +#endif // ENABLE_MODIFIERS_ALWAYS_TRANSPARENT volume.first->set_render_color(); +#if ENABLE_MODIFIERS_ALWAYS_TRANSPARENT + if (type == ERenderType::Transparent) + volume.first->force_transparent = false; +#endif // ENABLE_MODIFIERS_ALWAYS_TRANSPARENT // render sinking contours of non-hovered volumes if (m_show_sinking_contours) diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index d42bc26dcf..37fb7995b6 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -1286,12 +1286,14 @@ bool GLCanvas3D::is_reload_delayed() const void GLCanvas3D::enable_layers_editing(bool enable) { m_layers_editing.set_enabled(enable); +#if !ENABLE_MODIFIERS_ALWAYS_TRANSPARENT const Selection::IndicesList& idxs = m_selection.get_volume_idxs(); for (unsigned int idx : idxs) { GLVolume* v = m_volumes.volumes[idx]; if (v->is_modifier) v->force_transparent = enable; } +#endif // !ENABLE_MODIFIERS_ALWAYS_TRANSPARENT set_as_dirty(); } diff --git a/src/slic3r/GUI/Selection.cpp b/src/slic3r/GUI/Selection.cpp index 3ab9b7bdca..6a82ca8d3e 100644 --- a/src/slic3r/GUI/Selection.cpp +++ b/src/slic3r/GUI/Selection.cpp @@ -444,11 +444,25 @@ void Selection::clear() if (m_list.empty()) return; +#if ENABLE_MODIFIERS_ALWAYS_TRANSPARENT + // ensure that the volumes get the proper color before next call to render (expecially needed for transparent volumes) + for (unsigned int i : m_list) { + GLVolume& volume = *(*m_volumes)[i]; + volume.selected = false; + bool transparent = volume.color[3] < 1.0f; + if (transparent) + volume.force_transparent = true; + volume.set_render_color(); + if (transparent) + volume.force_transparent = false; + } +#else for (unsigned int i : m_list) { (*m_volumes)[i]->selected = false; // ensure the volume gets the proper color before next call to render (expecially needed for transparent volumes) (*m_volumes)[i]->set_render_color(); } +#endif // ENABLE_MODIFIERS_ALWAYS_TRANSPARENT m_list.clear();