mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-14 10:35:52 +08:00
SPE-1696 - Fixed crash when loading project while the camera is below the printbed
This commit is contained in:
parent
d431204c51
commit
ffbddd82ee
@ -439,6 +439,14 @@ void Bed3D::render_model(const Transform3d& view_matrix, const Transform3d& proj
|
|||||||
m_model_offset = to_3d(m_build_volume.bounding_volume2d().center(), -0.03);
|
m_model_offset = to_3d(m_build_volume.bounding_volume2d().center(), -0.03);
|
||||||
|
|
||||||
// register for picking
|
// register for picking
|
||||||
|
const std::vector<std::shared_ptr<SceneRaycasterItem>>* const raycaster = wxGetApp().plater()->canvas3D()->get_raycasters_for_picking(SceneRaycaster::EType::Bed);
|
||||||
|
if (!raycaster->empty()) {
|
||||||
|
// The raycaster may have been set by the call to init_triangles() made from render_texture() if the printbed was
|
||||||
|
// changed while the camera was pointing upward.
|
||||||
|
// In this case we need to remove it before creating a new using the model geometry
|
||||||
|
wxGetApp().plater()->canvas3D()->remove_raycasters_for_picking(SceneRaycaster::EType::Bed);
|
||||||
|
m_model.mesh_raycaster.reset();
|
||||||
|
}
|
||||||
register_raycasters_for_picking(m_model.model.get_geometry(), Geometry::translation_transform(m_model_offset));
|
register_raycasters_for_picking(m_model.model.get_geometry(), Geometry::translation_transform(m_model_offset));
|
||||||
|
|
||||||
// update extended bounding box
|
// update extended bounding box
|
||||||
|
Loading…
x
Reference in New Issue
Block a user