mirror of
https://git.mirrors.martin98.com/https://github.com/bambulab/BambuStudio.git
synced 2025-08-06 01:56:03 +08:00
FIX: render the opaque shell to the transparent shell
alpha channel is not need to update in shell Change-Id: I4ad3caa7d40f69ec799f1076cf617805ba1a240b (cherry picked from commit 315605926764121f6d0ccedf0e88a1ffc3aa0b46)
This commit is contained in:
parent
ca81c370fd
commit
cc447bf122
@ -1533,7 +1533,7 @@ void GLVolumeCollection::reset_outside_state()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GLVolumeCollection::update_colors_by_extruder(const DynamicPrintConfig* config)
|
void GLVolumeCollection::update_colors_by_extruder(const DynamicPrintConfig *config, bool is_update_alpha)
|
||||||
{
|
{
|
||||||
static const float inv_255 = 1.0f / 255.0f;
|
static const float inv_255 = 1.0f / 255.0f;
|
||||||
|
|
||||||
@ -1603,6 +1603,12 @@ void GLVolumeCollection::update_colors_by_extruder(const DynamicPrintConfig* con
|
|||||||
const Color& color = colors[extruder_id];
|
const Color& color = colors[extruder_id];
|
||||||
if (!color.text.empty()) {
|
if (!color.text.empty()) {
|
||||||
for (int i = 0; i < 4; ++i) {
|
for (int i = 0; i < 4; ++i) {
|
||||||
|
if (is_update_alpha == false) {
|
||||||
|
if (i < 3) {
|
||||||
|
volume->color[i] = (float) color.rgba[i] * inv_255;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
volume->color[i] = (float) color.rgba[i] * inv_255;
|
volume->color[i] = (float) color.rgba[i] * inv_255;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -702,7 +702,7 @@ public:
|
|||||||
bool check_outside_state(const Slic3r::BuildVolume& build_volume, ModelInstanceEPrintVolumeState* out_state) const;
|
bool check_outside_state(const Slic3r::BuildVolume& build_volume, ModelInstanceEPrintVolumeState* out_state) const;
|
||||||
void reset_outside_state();
|
void reset_outside_state();
|
||||||
|
|
||||||
void update_colors_by_extruder(const DynamicPrintConfig* config);
|
void update_colors_by_extruder(const DynamicPrintConfig *config, bool is_update_alpha = true);
|
||||||
|
|
||||||
// Returns a vector containing the sorted list of all the print_zs of the volumes contained in this collection
|
// Returns a vector containing the sorted list of all the print_zs of the volumes contained in this collection
|
||||||
std::vector<double> get_current_print_zs(bool active_only) const;
|
std::vector<double> get_current_print_zs(bool active_only) const;
|
||||||
|
@ -1217,7 +1217,7 @@ void GCodeViewer::refresh_render_paths()
|
|||||||
void GCodeViewer::update_shells_color_by_extruder(const DynamicPrintConfig* config)
|
void GCodeViewer::update_shells_color_by_extruder(const DynamicPrintConfig* config)
|
||||||
{
|
{
|
||||||
if (config != nullptr)
|
if (config != nullptr)
|
||||||
m_shells.volumes.update_colors_by_extruder(config);
|
m_shells.volumes.update_colors_by_extruder(config,false);
|
||||||
}
|
}
|
||||||
|
|
||||||
//BBS: always load shell at preview
|
//BBS: always load shell at preview
|
||||||
|
Loading…
x
Reference in New Issue
Block a user