mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-15 09:35:52 +08:00
Fix crash in debug mode with empty preview
This commit is contained in:
parent
faf4d8e6b0
commit
8470d4594d
@ -6648,7 +6648,9 @@ void GLCanvas3D::_load_sla_shells()
|
|||||||
for (const SLAPrintObject* obj : print->objects()) {
|
for (const SLAPrintObject* obj : print->objects()) {
|
||||||
unsigned int initial_volumes_count = (unsigned int)m_volumes.volumes.size();
|
unsigned int initial_volumes_count = (unsigned int)m_volumes.volumes.size();
|
||||||
for (const SLAPrintObject::Instance& instance : obj->instances()) {
|
for (const SLAPrintObject::Instance& instance : obj->instances()) {
|
||||||
add_volume(*obj, 0, instance, obj->get_mesh_to_print(), GLVolume::MODEL_COLOR[0], true);
|
auto & m = obj->get_mesh_to_print();
|
||||||
|
if (!m.empty()) {
|
||||||
|
add_volume(*obj, 0, instance, m, GLVolume::MODEL_COLOR[0], true);
|
||||||
// Set the extruder_id and volume_id to achieve the same color as in the 3D scene when
|
// Set the extruder_id and volume_id to achieve the same color as in the 3D scene when
|
||||||
// through the update_volumes_colors_by_extruder() call.
|
// through the update_volumes_colors_by_extruder() call.
|
||||||
m_volumes.volumes.back()->extruder_id = obj->model_object()->volumes.front()->extruder_id();
|
m_volumes.volumes.back()->extruder_id = obj->model_object()->volumes.front()->extruder_id();
|
||||||
@ -6657,6 +6659,7 @@ void GLCanvas3D::_load_sla_shells()
|
|||||||
if (auto &pad_mesh = obj->pad_mesh(); !pad_mesh.empty())
|
if (auto &pad_mesh = obj->pad_mesh(); !pad_mesh.empty())
|
||||||
add_volume(*obj, -int(slaposPad), instance, pad_mesh, GLVolume::SLA_PAD_COLOR, false);
|
add_volume(*obj, -int(slaposPad), instance, pad_mesh, GLVolume::SLA_PAD_COLOR, false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
double shift_z = obj->get_current_elevation();
|
double shift_z = obj->get_current_elevation();
|
||||||
for (unsigned int i = initial_volumes_count; i < m_volumes.volumes.size(); ++ i) {
|
for (unsigned int i = initial_volumes_count; i < m_volumes.volumes.size(); ++ i) {
|
||||||
// apply shift z
|
// apply shift z
|
||||||
|
Loading…
x
Reference in New Issue
Block a user