mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-23 04:58:20 +08:00
Removed needless calls to instance_bounding_box
This commit is contained in:
parent
e6bdec4aa5
commit
a3f3c868eb
@ -62,18 +62,21 @@ void GLGizmoHollow::set_sla_support_data(ModelObject* model_object, const Select
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_c->m_model_object != model_object || m_c->m_model_object_id != model_object->id()) {
|
bool something_changed = false;
|
||||||
|
|
||||||
|
if (m_c->m_model_object != model_object
|
||||||
|
|| m_c->m_model_object_id != model_object->id()
|
||||||
|
|| m_c->m_active_instance != selection.get_instance_idx()) {
|
||||||
m_c->m_model_object = model_object;
|
m_c->m_model_object = model_object;
|
||||||
m_c->m_print_object_idx = -1;
|
m_c->m_print_object_idx = -1;
|
||||||
|
m_c->m_active_instance = selection.get_instance_idx();
|
||||||
|
something_changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_c->m_active_instance = selection.get_instance_idx();
|
if (model_object && something_changed && selection.is_from_single_instance())
|
||||||
|
|
||||||
if (model_object && selection.is_from_single_instance())
|
|
||||||
{
|
{
|
||||||
// Cache the bb - it's needed for dealing with the clipping plane quite often
|
// Cache the bb - it's needed for dealing with the clipping plane quite often
|
||||||
// It could be done inside update_mesh but one has to account for scaling of the instance.
|
// It could be done inside update_mesh but one has to account for scaling of the instance.
|
||||||
//FIXME calling ModelObject::instance_bounding_box() is expensive!
|
|
||||||
m_c->m_active_instance_bb_radius = m_c->m_model_object->instance_bounding_box(m_c->m_active_instance).radius();
|
m_c->m_active_instance_bb_radius = m_c->m_model_object->instance_bounding_box(m_c->m_active_instance).radius();
|
||||||
|
|
||||||
if (is_mesh_update_necessary()) {
|
if (is_mesh_update_necessary()) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user