Fix crash when click the color paint gizmo when object part is selected (#3405)

Fix crash when click the color paint gizmo when object part is selected (#3404)

Cherry-picked from bambulab/BambuStudio@1e99ce9535

Co-authored-by: liz.li <liz.li@bambulab.com>
This commit is contained in:
Noisyfox 2024-01-01 13:45:53 +08:00 committed by GitHub
parent 60ab79cae0
commit 8fd4477110
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -110,7 +110,9 @@ void SelectionInfo::on_update()
m_model_object = nullptr; m_model_object = nullptr;
if (selection.is_single_full_instance()) { // BBS still keep object pointer when selection is volume
// if (selection.is_single_full_instance()) {
if (!selection.is_empty()) {
m_model_object = selection.get_model()->objects[selection.get_object_idx()]; m_model_object = selection.get_model()->objects[selection.get_object_idx()];
m_z_shift = selection.get_first_volume()->get_sla_shift_z(); m_z_shift = selection.get_first_volume()->get_sla_shift_z();
} }