Fixed crash when scaling object to fit print volume with SLA printers
This commit is contained in:
parent
e585fd2221
commit
84284b4418
1 changed files with 5 additions and 4 deletions
|
@ -2119,10 +2119,11 @@ void GLCanvas3D::reload_scene(bool refresh_immediately, bool force_full_scene_re
|
||||||
|
|
||||||
// Shift-up all volumes of the object so that it has the right elevation with respect to the print bed
|
// Shift-up all volumes of the object so that it has the right elevation with respect to the print bed
|
||||||
for (GLVolume* volume : m_volumes.volumes) {
|
for (GLVolume* volume : m_volumes.volumes) {
|
||||||
if (volume->object_idx() < (int)m_model->objects.size() && m_model->objects[volume->object_idx()]->instances[volume->instance_idx()]->is_printable()) {
|
const ModelObject* model_object = (volume->object_idx() < (int)m_model->objects.size()) ? m_model->objects[volume->object_idx()] : nullptr;
|
||||||
const SLAPrintObject* po = sla_print->objects()[volume->object_idx()];
|
if (model_object != nullptr && model_object->instances[volume->instance_idx()]->is_printable()) {
|
||||||
float zoffs = po->get_current_elevation() / sla_print->relative_correction().z();
|
const SLAPrintObject* po = sla_print->get_print_object_by_model_object_id(model_object->id());
|
||||||
volume->set_sla_shift_z(zoffs);
|
if (po != nullptr)
|
||||||
|
volume->set_sla_shift_z(po->get_current_elevation() / sla_print->relative_correction().z());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue